Redirecting UnsubscribePage.html to custom preference center w/token
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.
- Customer clicks Unsubscribe/Manage Preferences {system.UnsubscribeLink}
- Customer lands on Marketo LP UnsubscribePage.html
- Ideally Mkto passes tokenID from record, then via JS, forwards them to preferencecenter.com/{{lead.tokenID}}
<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?