Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Include allowedVendor param and update ModuleId value v2 #14

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/identity-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ For more userIdentity types, see https://docs.mparticle.com/developers/sdk/web/i

function IdentityHandler(common) {
this.common = common || {};
this.allowedVendors = [ '131', 'ID5-1747' ];
alexs-mparticle marked this conversation as resolved.
Show resolved Hide resolved
}
IdentityHandler.prototype.onUserIdentified = function() {};
IdentityHandler.prototype.onIdentifyComplete = function() {};
Expand All @@ -31,7 +32,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.allowedVendors
}
})
var logId5Id = this.common.logId5Id;

id5Instance.onAvailable(function(status){
Expand All @@ -43,7 +50,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.allowedVendors
}
})
var logId5Id = this.common.logId5Id;

id5Instance.onAvailable(function(status){
Expand Down
10 changes: 8 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 @@ -27,7 +28,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: this.vendors
}
})

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