Tracking Link Clicks in Marketo's Textarea Custom Field | Community
Skip to main content
cagarwal
New Participant
July 25, 2023
Solved

Tracking Link Clicks in Marketo's Textarea Custom Field

  • July 25, 2023
  • 2 replies
  • 1365 views

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!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

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.

2 replies

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
July 25, 2023

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.

Michael_Florin-2
New Participant
July 25, 2023

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.