Marketo System Asset ID to attached to links as Parameter in Email

Diana-Gilman
Level 1
Hi Everyone, I'm looking for some help with Velocity scripting to auto populate the Email ID (or Asset ID) in order to include this Marketo system Asset ID as a parameter attached to the links in my email. I found a few articles in the community (like this one: https://nation.marketo.com/t5/ideas/email-id-system-token/idi-p/278839#comments) that uses Velocity scripting to extract the email ID from the xMarketoIdHdr header. 
 
I used the script from this post and the VS token I created does work and populated the Asset ID if added to the email as token within a text element. However, when I add this token or variable to my URL as a parameter, this does not appear to work unless I disable my tracking which is what I don't want.
 
So, when I append the URL to include this VS Token parameter, this is the result and the EmailID looks like this (also note that the Asset ID isn't populated here:

https://www.example.com/index.html?cta_id=article-ban-masthead&EmailID=&mkt_tok=MjEyLVRDVS0wMzQAAAGc...

However, when I disable tracking, the URL looks like:
https://www.example.com/index.html?cta_id=article-ban-masthead&EmailID=26408
 
Does anyone know if there are any tricks or a solution or work around? 

Thanks a lot!
1 REPLY 1
SanfordWhiteman
Level 10 - Community Moderator

The only supported way to use tracked links + Velocity is to output the entire <a> tag from Velocity.

 

But let’s step back and make sure we don’t have an XY Problem. What is the full business requirement (not specific technical implementation) that you are trying to meet?