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 #13

Closed
Closed
Show file tree
Hide file tree
Changes from all 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
24 changes: 20 additions & 4 deletions dist/ID5Kit.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't check in the /dist folder in your PRs. These files are built when we release and any merge conflicts will prevent us from using automated releases.

partnerId: this.common.partnerId,
pd: partnerData,
consentData: {
allowedVendors: [ '131', 'ID5-1747' ]
}
});
var logId5Id = this.common.logId5Id;

id5Instance.onAvailable(function(status){
Expand All @@ -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){
Expand All @@ -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.
Expand All @@ -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());
Expand Down
24 changes: 20 additions & 4 deletions dist/ID5Kit.iife.js
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand All @@ -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){
Expand All @@ -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.
Expand All @@ -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());
Expand Down
17 changes: 14 additions & 3 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: [ '131', 'ID5-1747' ]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you're repeating some of these string values and there's a slight risk of some typos. I would make these values into constants so they can be reused and give us some safety.

}
})
var logId5Id = this.common.logId5Id;

id5Instance.onAvailable(function(status){
Expand All @@ -40,10 +46,15 @@ IdentityHandler.prototype.onLoginComplete = function(
}
};

//Must re-initialize ID5 without partner identities (pd) in the config to revert to an anonymous ID5 ID
//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){
Expand Down
9 changes: 7 additions & 2 deletions src/initialization.js
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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());
Expand Down
Loading