Hi Sanford,
first of all, thanks for the rapid response. I am just not sure if I implemented your code correctly. Apparently the way I did didn't work. I tried it in a couple of different ways as well then, but neither created the Visit Web Page activity right after accepting the cookie, we're back to anonymous now.
Here's the latest and how I understand I should implement your code in the greater context:
if (window.__mktTokVal && history.replaceState) {
var restoredLoc = document.createElement("a");
restoredLoc.href = document.location.href;
restoredLoc.search += (restoredLoc.search ? "&" : "") + "mkt_tok=" + window.__mktTokVal;
history.replaceState({}, null, restoredLoc.href);
}
(function () {
function detectMunchkinLibLoadComplete(e) {
if (e.target.tagName === "SCRIPT" && /\/\d+\/munchkin\.js/.test(e.target.src)) {
// remove the mkt_tok here
window.history.pushState({}, document.title, document.location.origin + document.location.pathname);
document.removeEventListener("load", detectMunchkinLibLoadComplete, true);
}
}
document.addEventListener("load", detectMunchkinLibLoadComplete, true);
Munchkin.init();
})();
Isn't that initializing the Munchkin after the mkt_tok has been removed from the URL again? Thanks for your help!
... View more