SOLVED

Tracking Link Clicks in Marketo's Textarea Custom Field

Go to solution
cagarwal
Level 3

Tracking Link Clicks in Marketo's Textarea Custom Field

Hi Community!

 

We want to send personalized content recommendations to our users and upload HTML snippets for each one via API into a textarea token on Marketo. But, we're wondering how we can track link clicks inside this token. Here's an example of the snippet we'll have in the textarea box (remember, this will vary for each user):

<a href="https://123.com">Link 1</a> <br />
<a href="https://1234.com">Link 2</a> <br />
<a href="https://1235.com">Link 3</a> <br />

Any ideas on how to make this work? Thanks!

CA
1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Tracking Link Clicks in Marketo's Textarea Custom Field

You can only do this if you pre-process the field via Velocity. That is, don’t output the {{lead.token}} directly, create a Velocity token that parses it and creates new output with the links.

 

However, to go this route, you don’t want to include actual HTML since Velocity doesn’t have an HTML parser. Instead you’d include JSON, which is parseable:

[
{
  "text" : "Link 1",
  "hrefNoProto" : "1234.com"
},
{
  "text" : "Link 2",
  "hrefNoProto" : "4567.com"
},
{
  "text" : "Link 3",
  "hrefNoProto" : "6789.com"
}
]

 

Parsing JSON in Velocity is covered in a lot of past posts.

 

Note there’s no reason to include the protocol in the JSON because you have strip it out anyway.

View solution in original post

2 REPLIES 2
Michael_Florin
Level 10

Re: Tracking Link Clicks in Marketo's Textarea Custom Field

Your questions sounds as if you knew that this is not supposed to work, right?

 

https://nation.marketo.com/t5/knowledgebase/how-to-track-tokenized-links-in-email-assets/ta-p/254486

 

So no, I don't have an immediate idea. You might want to reconsider your process if you really need that link tracking.

SanfordWhiteman
Level 10 - Community Moderator

Re: Tracking Link Clicks in Marketo's Textarea Custom Field

You can only do this if you pre-process the field via Velocity. That is, don’t output the {{lead.token}} directly, create a Velocity token that parses it and creates new output with the links.

 

However, to go this route, you don’t want to include actual HTML since Velocity doesn’t have an HTML parser. Instead you’d include JSON, which is parseable:

[
{
  "text" : "Link 1",
  "hrefNoProto" : "1234.com"
},
{
  "text" : "Link 2",
  "hrefNoProto" : "4567.com"
},
{
  "text" : "Link 3",
  "hrefNoProto" : "6789.com"
}
]

 

Parsing JSON in Velocity is covered in a lot of past posts.

 

Note there’s no reason to include the protocol in the JSON because you have strip it out anyway.