Hi Community,
Looking for more guidance on UTM best practices as we work towards more scalable solutions.
Currently we use velocity script tokens that contain the entire link (since I know not doing so can often cause issues) and we do a data value update right before the email send to update UTM variables referenced in said link.
Example Link:
https://www.virtahealth.com/thevirtatreatment?utm_source=MarketoCommunity&utm_campaign=2019-Q3-Implementation&utm_content=UTMBestPractices
What I've found odd is that click tracking does work, but it appears to be inconsistent (sometimes the mkttoken hash is appended to the url for tracking; sometimes not).
Is there anything that I'm missing as far as why the clicks would come through sometimes but not always when using the same implementation protocol? Marketo support has advised that our execution is correct so wondering if anyone has struggled with this issue or might have a better solution.
As you can imagine, we're trying to make the click tracking work for script tokens because it would be an immense amount of work to make each email dynamic given the number of custom links/UTM combos we use now and in the future.
Appreciate the help!
Solved! Go to Solution.
OK, the conditional output means you need Velocity instead of text tokens. But you shouldn't be outputting only the URL! The entire link (opening <a> to closing </a>) should be in VTL. This is in fact the standard way to build trackable links in Velocity. No one should have told you otherwise.
Also, couple more things while we're here.
You shouldn't use curly braces (formal notation) here:
#if(${lead.Parent_Campaign__c} == "XXXX")
And also it's better to use .equals() over == to avoid surprises. (I still use == without thinking sometimes, despite my declaration a year ago to stop after getting bitten by a strange bug in some client code!)
So this line can be:
#if( $lead.Parent_Campaign__c.equals("XXXX") )
Your example doesn't show a full-fledged <a>, only the href. Is that an accurate example of the whole token?
And why (even though Velocity is one of my specialties) are you using Velocity instead of {{lead.tokens}}? Is there calculation/escaping/other logic going on?
Hi Sanford,
Yes, absolutely! To clarify - we're sending one email to different audiences and each audience receives a specific landing page. Each email send also needs to have changing UTM parameters to best address attribution for each audience/email.
Right now, my token {{my.LandingPage}} includes a case for each special landing page, for instance:
#if(${lead.Parent_Campaign__c} == "XXXX")
#set($landingPage = "www.virtahealth.com/thevirtatreatment?utm_source=MarketoCommunity&utm_campaign=${lead.utmcampaign}&utm_content=${lead.utmcontent}")
Within the campaign before the time of send, those data values are updated for lead.utmcampaign and lead.utmcontent (source stays the same, so the value is just within the token).
In the email itself, the <a> is as follows:
<a href="{{my.LandingPage}}"></a>
Based on my consultations with marketo during our launch and reading through the dev docs, it was my understanding that using velocity tokens was the best way to handle this sort of scenario. Are you saying there is a better way based on updating the lead itself via {{lead.tokens}}? If so, I plan to absolutely read up on that.
Thanks for your guidance!
OK, the conditional output means you need Velocity instead of text tokens. But you shouldn't be outputting only the URL! The entire link (opening <a> to closing </a>) should be in VTL. This is in fact the standard way to build trackable links in Velocity. No one should have told you otherwise.
Also, couple more things while we're here.
You shouldn't use curly braces (formal notation) here:
#if(${lead.Parent_Campaign__c} == "XXXX")
And also it's better to use .equals() over == to avoid surprises. (I still use == without thinking sometimes, despite my declaration a year ago to stop after getting bitten by a strange bug in some client code!)
So this line can be:
#if( $lead.Parent_Campaign__c.equals("XXXX") )
Fascinating, thank you so much for the extra insights! I'll work on incorporating your solution this week. Appreciate all your help