Skip to main content
Level 2
May 30, 2024 3:06 PM UTC
Solved

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?

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
Jun 3, 2024 2:23 PM UTC

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.

4 replies

SanfordWhiteman
Level 10
May 30, 2024 4:44 PM UTC

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!

Translate
NickWa7Author
Level 2
Jun 3, 2024 2:10 PM UTC

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.

Translate
SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
Jun 3, 2024 2:23 PM UTC

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.

Translate