SOLVED

Unsubscribe Link in Program Token in Snippet

Go to solution
Michael_Florin
Level 9

Unsubscribe Link in Program Token in Snippet

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?

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Unsubscribe Link in Program Token in Snippet

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.

View solution in original post

4 REPLIES 4
SanfordWhiteman
Level 10 - Community Moderator

Re: Unsubscribe Link in Program Token in Snippet

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.

View solution in original post

Michael_Florin
Level 9

Re: Unsubscribe Link in Program Token in Snippet

Thank you, Sanford!

Michael_Florin
Level 9

Re: Unsubscribe Link in Program Token in Snippet

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


<a href="https://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.

SanfordWhiteman
Level 10 - Community Moderator

Re: Unsubscribe Link in Program Token in Snippet

Better to say "not evaluated in a nested token within a snippet" then. Bottom line — it's not eval'd as a variable placeholder but just as text.