Skip to content

Commit

Permalink
Fix: Include allowedVendor param and update ModuleId value v2 (#14) (#15
Browse files Browse the repository at this point in the history
)
  • Loading branch information
gh-mmurph authored Jan 30, 2025
1 parent 1797c75 commit 4911e0a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
15 changes: 13 additions & 2 deletions src/identity-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ IdentityHandler.prototype.onLoginComplete = function(
var partnerData = this.common.buildPartnerData(mParticleUser);

if (partnerData) {
var id5Instance = window.ID5.init({partnerId: this.common.partnerId, pd: partnerData})
var id5Instance = window.ID5.init({
partnerId: this.common.partnerId,
pd: partnerData,
consentData: {
allowedVendors: this.common.allowedVendors
}
})
var logId5Id = this.common.logId5Id;

id5Instance.onAvailable(function(status){
Expand All @@ -43,7 +49,12 @@ IdentityHandler.prototype.onLoginComplete = function(
//Must re-initialize ID5 without partner identities (pd) in the config to revert to an anonymous ID5 ID
IdentityHandler.prototype.onLogoutComplete = function(
) {
var id5Instance = window.ID5.init({partnerId: this.common.partnerId})
var id5Instance = window.ID5.init({
partnerId: this.common.partnerId,
consentData: {
allowedVendors: this.common.allowedVendors
}
})
var logId5Id = this.common.logId5Id;

id5Instance.onAvailable(function(status){
Expand Down
11 changes: 9 additions & 2 deletions src/initialization.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var initialization = {
name: 'ID5',
moduleId: '248',
moduleId: 248,
vendors: [ '131', 'ID5-1747' ],
/* ****** Fill out initForwarder to load your SDK ******
Note that not all arguments may apply to your SDK initialization.
These are passed from mParticle, but leave them even if they are not being used.
Expand All @@ -14,6 +15,7 @@ var initialization = {
common.partnerId = forwarderSettings.partnerId;
common.id5IdType = forwarderSettings.id5IdType;
common.moduleId = this.moduleId;
common.allowedVendors = this.vendors;

if (!testMode) {
/* Load your Web SDK here using a variant of your snippet from your readme that your customers would generally put into their <head> tags
Expand All @@ -27,7 +29,12 @@ var initialization = {
id5Script.onload = function() {
isInitialized = true;

var id5Instance = window.ID5.init({partnerId: common.partnerId})
var id5Instance = window.ID5.init({
partnerId: common.partnerId,
consentData: {
allowedVendors: common.allowedVendors
}
})

id5Instance.onAvailable(function(status){
common.logId5Id(status.getUserId());
Expand Down

0 comments on commit 4911e0a

Please sign in to comment.