SOLVED

Re: Velocity Token URL Parameter, Tracked but Not Rendering

Go to solution
Kenway_Du
Level 1

Velocity Token URL Parameter, Tracked but Not Rendering

Hello, 

I'm trying to create an email that links to a survey, and that link needs to have a province parameter that is displayed via a velocity script that fetches the information from a custom object. 

Basic example:

Fill out this survey

"this survey" would be hyperlinked to "https://www.survey.com?prov=Ontario"

The "Ontario" value represents the province of a clinic they recently had an appointment with, and would use the clinic ID to fetch the province via velocity script from a custom object. 

The issue is that we need this link to be trackable, and I read in other posts that in order to have it trackable, I'd need to output the entire <a> tag from the velocity token itself. So I've tried:

Name of script token: {{my.SurveyLink}}

#set($CID = ${lead.recentDischargeClinicID})
##if clinic id found
#if($clinics.Map.get($CID))
<a href="https://www.survey.com/?prov=$clinics.Map.get($CID).PROV">this survey</a>
#end

In my email, I have:

<p>Fill out {{my.SurveyLink}}</p>

I sent a live email to myself to test it. The good news is it tracks the click.. The bad news is the parameter token doesn't render (i.e. the URL becomes "https://www.survey.com/?prov=$clinics.Map.get($CID).PROV")

Would anyone be able to point out what I could change to have the token render properly and also have the link be trackable?

Thanks

Kenway

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Velocity Token URL Parameter, Tracked but Not Rendering

Try

<a href="https://www.survey.com/?prov=${clinics.Map.get($CID).PROV}">this survey</a>

View solution in original post

7 REPLIES 7
SanfordWhiteman
Level 10 - Community Moderator

Re: Velocity Token URL Parameter, Tracked but Not Rendering

Please highlight your code using the Advanced Editor's syntax highlighter so it's readable.

Then we'll continue.

Kenway_Du
Level 1

Re: Velocity Token URL Parameter, Tracked but Not Rendering

Sorry Sanford Whiteman‌, would you please direct me to where I'd find the Advanced Editor? I've never used it. 

SanfordWhiteman
Level 10 - Community Moderator

Re: Velocity Token URL Parameter, Tracked but Not Rendering

Right here:

pastedImage_1.png

And then follow this steps from this prerecorded GIF:

pastedImage_3.gif

Kenway_Du
Level 1

Re: Velocity Token URL Parameter, Tracked but Not Rendering

Here is the script token where I tried to output the entire <a> tag as recommended.

#set($CID = ${lead.recentDischargeClinicID})
##if clinic id found
#if($clinics.Map.get($CID))
<a href="https://www.survey.com/?prov=$clinics.Map.get($CID).PROV">this survey</a>
#end
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

The token renders when I add the class="mktNoTrack mktNoTok". But then I'm not able to track the click performance of this link, which is important for this email.

SanfordWhiteman
Level 10 - Community Moderator

Re: Velocity Token URL Parameter, Tracked but Not Rendering

Try

<a href="https://www.survey.com/?prov=${clinics.Map.get($CID).PROV}">this survey</a>
Kenway_Du
Level 1

Re: Velocity Token URL Parameter, Tracked but Not Rendering

Sanford Whiteman‌ You are a gentleman and a scholar. It worked like a charm. Thank you so much. 

SanfordWhiteman
Level 10 - Community Moderator

Re: Velocity Token URL Parameter, Tracked but Not Rendering

Awesome!