For context here, following the advice to have an email comprised almost entirely of email script tokens. However, none of the tracked links such as CTA Urls are rendering correctly. Hoping there is a workaround for this other than having to disable tracking for all the links in our emails to populate. We are currently using this for a performance snapshot email where all the values in the tokens will differ from person to person, displaying things such as unique page views for that contact. All of these tokens are email script tokens that pull data from the custom object. There are 63 token values in this email that are being updated.
Each token looks like this to pull in the value from that CO field: ${vMC_cList.get(0).op_cta_text}. I was wondering if anyone has found a resolution other than what I found on the community here
Thank you in advance!
Are you able to share the velocity script you’re using for this? Additionally, you should check out Sandy’s blog on:
Hi Darshil -
All that is in the email script token is
${vMC_cList.get(0).performance_cta_url}
In the body of the email the link is set up as
<a href="{{my.VMC-PERFORMANCE-CTA-URL}}">{{my.VMC-PERFORMANCE-CTA-TEXT}}</a>
Reading the article it would seem like we'd need every possible URL that could be populated in that email script, correct?
First of all, you should include the protocol in the <a> tag instead of adding it to the token value itself. Also, I'd advise you to output the fully formed <a> tags from the VTL instead of outputting the bare URLs and trying to plug them in the <a> tags in the email content.
<a href="https://{{my.VMC-PERFORMANCE-CTA-URL}}">{{my.VMC-PERFORMANCE-CTA-TEXT}}</a>
Hi Darshil - Thank you for that. I will look to see if it is possible to get all the variations we might have for a given link in this email. Thank you again!
All that is in the email script token is${vMC_cList.get(0).performance_cta_url}
That’s just outputting the same property of the same item (the first/0th item). Don’t understand why you’d want that, even if it did emit a trackable link each time.
Like Darshil says, you need to emit the (full) <a> from Velocity. And as my blog post indicates, you need to use different variables for each.
Thank you, Sanford! I'll admit my knowledge of Velocity Scripting is pretty minimal so this is all new to me. The data we receive from the SQS queue for the CTA is just the URL without the https://. Going to see if it is possible with this workaround to get all the base URL possibilities to work on this.
How would this work with URL parameters? Would that need to be a separate custom object field. For example, currently the URL that we has ?htid=759 (an internal parameter) at the end of it. The number is unique so I am assume that would need to be parsed out separately from the URL value?
Well, if your integration is writing URLs without https:// in the CO field, then you can include it outside the custom object URL field token to ensure that the URLs are tracked (protocol should always be placed outside, and should not be included as a part of the field value). Also, I don't see any issue if the query parameters are appended to the URL itself by the integration.