We are working on implementing a custom preference center outside of Marketo. I have been looking at ways to repurpose this landing page to retrieve their preference center token, then forwarding them to a tokenized URL.
<script>
setTimeout(function() {
window.location.href='https://www.preferencecenter.com/{{lead.tokenID}}'
}, 7000);
</script>
The redirect works, but the token does not appear until the page is visited a second time or refreshed prior to redirect. Is there any way we can force this token to appear on the first visit for all users who have a {lead.tokenID}? Can we leverage the form prefill for this kind of functionality despite this not being a form page?
Solved! Go to Solution.
OK. Always best to describe what you expect your code to do in order to contrast those expectations with observed behavior.
In any case there's zero reason for a {{lead.token}} to not output a value if the person has that field populated. {{lead.tokens}} would be useless if you couldn't rely on a tracked Marketo link to result in personalized output.
Don’t understand that incredibly long 7 second delay. What exactly are you expecting to happen in that period?
The {{lead.token}} will always be available when viewing a mkt_tok_enized link — assuming of course it has a value in in Marketo. And even if it weren’t available, waiting 7 seconds won’t do anything because the page is already rendered!
Displaying a short message about our new preference center experience vs redirecting immediately which can be a confusing experience, especially if the tokenized version of the link does not work. I am confident however, that the number of seconds is the least important part of the issue we're trying to resolve.
OK. Always best to describe what you expect your code to do in order to contrast those expectations with observed behavior.
In any case there's zero reason for a {{lead.token}} to not output a value if the person has that field populated. {{lead.tokens}} would be useless if you couldn't rely on a tracked Marketo link to result in personalized output.
Thank you -- we will continue to test, otherwise I will consider this closed as it sounds like the methods being used are correct.