From 639ba475a18031780538db8face4a86d9c15615f Mon Sep 17 00:00:00 2001 From: Michael Murphy Date: Wed, 11 Dec 2024 09:56:21 -0500 Subject: [PATCH] Fix: Include allowedVendor param and update ModuleId value --- dist/ID5Kit.common.js | 24 ++++++++++++++++++++---- dist/ID5Kit.iife.js | 24 ++++++++++++++++++++---- src/identity-handler.js | 15 +++++++++++++-- src/initialization.js | 9 +++++++-- 4 files changed, 60 insertions(+), 12 deletions(-) diff --git a/dist/ID5Kit.common.js b/dist/ID5Kit.common.js index 75d6d4f..e95755f 100644 --- a/dist/ID5Kit.common.js +++ b/dist/ID5Kit.common.js @@ -1264,7 +1264,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: [ '131', 'ID5-1747' ] + } + }); var logId5Id = this.common.logId5Id; id5Instance.onAvailable(function(status){ @@ -1276,7 +1282,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: [ '131', 'ID5-1747' ] + } + }); var logId5Id = this.common.logId5Id; id5Instance.onAvailable(function(status){ @@ -1296,7 +1307,7 @@ var identityHandler = IdentityHandler; var initialization = { name: 'ID5', - moduleId: '248', + moduleId: 248, /* ****** 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. @@ -1322,7 +1333,12 @@ var initialization = { id5Script.onload = function() { - var id5Instance = window.ID5.init({partnerId: common.partnerId}); + var id5Instance = window.ID5.init({ + partnerId: common.partnerId, + consentData: { + allowedVendors: [ '131', 'ID5-1747' ] + } + }); id5Instance.onAvailable(function(status){ common.logId5Id(status.getUserId()); diff --git a/dist/ID5Kit.iife.js b/dist/ID5Kit.iife.js index 177195e..d528a5e 100644 --- a/dist/ID5Kit.iife.js +++ b/dist/ID5Kit.iife.js @@ -1263,7 +1263,13 @@ var ID5Kit = (function (exports) { 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: [ '131', 'ID5-1747' ] + } + }); var logId5Id = this.common.logId5Id; id5Instance.onAvailable(function(status){ @@ -1275,7 +1281,12 @@ var ID5Kit = (function (exports) { //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: [ '131', 'ID5-1747' ] + } + }); var logId5Id = this.common.logId5Id; id5Instance.onAvailable(function(status){ @@ -1295,7 +1306,7 @@ var ID5Kit = (function (exports) { var initialization = { name: 'ID5', - moduleId: '248', + moduleId: 248, /* ****** 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. @@ -1321,7 +1332,12 @@ var ID5Kit = (function (exports) { id5Script.onload = function() { - var id5Instance = window.ID5.init({partnerId: common.partnerId}); + var id5Instance = window.ID5.init({ + partnerId: common.partnerId, + consentData: { + allowedVendors: [ '131', 'ID5-1747' ] + } + }); id5Instance.onAvailable(function(status){ common.logId5Id(status.getUserId()); diff --git a/src/identity-handler.js b/src/identity-handler.js index 477025f..c3c1381 100644 --- a/src/identity-handler.js +++ b/src/identity-handler.js @@ -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: [ '131', 'ID5-1747' ] + } + }) var logId5Id = this.common.logId5Id; id5Instance.onAvailable(function(status){ @@ -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: [ '131', 'ID5-1747' ] + } + }) var logId5Id = this.common.logId5Id; id5Instance.onAvailable(function(status){ diff --git a/src/initialization.js b/src/initialization.js index 8f79565..74091e9 100644 --- a/src/initialization.js +++ b/src/initialization.js @@ -1,6 +1,6 @@ var initialization = { name: 'ID5', - moduleId: '248', + moduleId: 248, /* ****** 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. @@ -27,7 +27,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: [ '131', 'ID5-1747' ] + } + }) id5Instance.onAvailable(function(status){ common.logId5Id(status.getUserId());