Unsubscribe Link in Program Token in Snippet | Community
Skip to main content
Michael_Florin-2
New Participant
March 11, 2021
Solved

Unsubscribe Link in Program Token in Snippet

  • March 11, 2021
  • 1 reply
  • 2829 views

Hello,

 

we just noticed something  unexpected and I wonder if any of you had an idea.

 

We usually store the link to our Marketo unsubscribe page in a program token:

 

{{my.unsubscribe-link}} = lp.example.com/Unsubscribe?mkt_unsubscribe=1&mkt_tok=##MKT_TOK##


Where on the email we have something like this:

<a href="https://{{my.unsubscribe-link}}" style="text-decoration: none;">{{my.unsubscribe-text}}</a>

Standard stuff, I guess, and everything works well.

 

Now, if we put the same mechanism into a snippet, the token version does not work anymore. After clicking the link, this remains in the browser URL:

https://lp.example.com/Unsubscribe?mkt_unsubscribe=1##MKT_TOK## 

That looks funky and of course it also doesn't work. The form field for the email address is not populated.

Whereas if we "hard code" the unsubscribe link directly into the snippet, the link works as expected. It is displayed as 

https://lp.example.com/Unsubscribe?mkt_unsubscribe=1&mkt_tok=Njc3LVhOVS0yMDMAAAF7wLqgKcm___verylongstring 

then the mkt_tok parameter vanishes after a split second, and the URL reads

https://lp.example.com/Unsubscribe?mkt_unsubscribe=1 

and populates the form field.

--------------------

Any idea why this link wouldn't work as a token in a snippet?

Best answer by SanfordWhiteman

The simple, albeit tautological, answer is that the special variable ##MKT_TOK## (probably the most special of all Marketo variables) isn't evaluated in Snippets.

 

You could try using a Velocity token in the snippet and use $mktmail.MKT_TOK instead.

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
March 13, 2021

The simple, albeit tautological, answer is that the special variable ##MKT_TOK## (probably the most special of all Marketo variables) isn't evaluated in Snippets.

 

You could try using a Velocity token in the snippet and use $mktmail.MKT_TOK instead.

Michael_Florin-2
New Participant
March 15, 2021

Thank you, Sanford!

Michael_Florin-2
New Participant
March 15, 2021

A co-worker just rightfully objected that if we put the complete link in the snippet - like


<a href="lp.example.com/Unsubscribe?mkt_unsubscribe=1&mkt_tok=##MKT_TOK##}" style="text-decoration: none;">{{my.unsubscribe-text}}</a>

 

it works fine. So in that case ##MKT_TOK## is resolved correctly it seems.