SOLVED

stripmkttok.js

Go to solution
Highlighted
Level 6

stripmkttok.js

Has anyone run into this and perhaps have any insight as to what the context is on why Marketo is now removing mkt_tok values after the URL resolves? So far, I've found this to be happening on all Marketo hosted landing pages that are linked from an email with mkt_tok and the view as webpage link.

Looks to be happening in multiple sandboxes and instances so it seems to be a global thing perhaps?

Started seeing this exactly on the release date.

Anything would help at this moment, documentation, release notes, etc.

Full script:

// LM-100892: Once page process mkt_tok, remove parameter from URL

(function() {

var afterLoad = function (fn) {

if (window.attachEvent) {

window.attachEvent('onload', fn);

} else {

window.addEventListener('load', fn);

}

},

// get parameter from URL

getURLParameter = function (name) {

var returnVal = decodeURIComponent((new RegExp(name + '=' + '(.+?)(&|$)').exec(location.search) || ['', null])[1]);

return returnVal;

}

afterLoad(function () {

// Cache mkt_tok value into global variable, before stripping it from URL

window.__mktTokVal = window.__mktTokVal || getURLParameter('mkt_tok');

window.history && history.replaceState('', null, location.pathname + location.search.replace(/(\?)?mkt_tok=(.*?)(&|$)/gi, '$1$3') + location.hash);

});

})();

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Level 10 - Community Moderator

Re: stripmkttok.js

Yes, search for the support article on View As Web Page links not being shareable.

It's a regression masquerading as a fix, IMO. Not a good thing.

View solution in original post

2 REPLIES 2
Highlighted
Level 10 - Community Moderator

Re: stripmkttok.js

Yes, search for the support article on View As Web Page links not being shareable.

It's a regression masquerading as a fix, IMO. Not a good thing.

View solution in original post

Highlighted
Level 6