Skip to content

Commit

Permalink
Update CMP tag
Browse files Browse the repository at this point in the history
  • Loading branch information
kmjennison committed Dec 13, 2022
1 parent 3ca3126 commit 9aa7f6a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/components/TabCMPHeadElements.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ const TabCMPHeadElements = () => (
// var host = window.location.hostname;
// var element = document.createElement('script');
// var firstScript = document.getElementsByTagName('script')[0];
// var url = 'https://quantcast.mgr.consensu.org'
// .concat('/choice/', 'FPBLJYpJgR9Zu', '/', host, '/choice.js')
// var url = 'https://cmp.quantcast.com'
// .concat('/choice/', 'FPBLJYpJgR9Zu', '/', host, '/choice.js?tag_version=V2');
var uspTries = 0;
var uspTriesLimit = 3;
// element.async = true;
Expand Down Expand Up @@ -145,6 +145,9 @@ const TabCMPHeadElements = () => (
args[2](retr);
}
} else {
if(args[0] === 'init' && typeof args[3] === 'object') {
args[3] = Object.assign(args[3], { tag_version: 'V2' });
}
queue.push(args);
}
}
Expand Down Expand Up @@ -178,7 +181,9 @@ const TabCMPHeadElements = () => (
if (msgIsString) {
returnMsg = JSON.stringify(returnMsg);
}
event.source.postMessage(returnMsg, '*');
if (event && event.source && event.source.postMessage) {
event.source.postMessage(returnMsg, '*');
}
},
payload.parameter
);
Expand Down Expand Up @@ -245,7 +250,7 @@ const TabCMPHeadElements = () => (
const storedUSPPingData = JSON.parse(localStorage.getItem('tabCMP.uspPing.data'))
if (storedUSPPingData) {
const cb = arg[2]
cb(storedUSPPingData, true )
cb(storedUSPPingData, true)
return
} else {
}
Expand Down

0 comments on commit 9aa7f6a

Please sign in to comment.