Business requirement is to add specific URL in the email assets including UTM parameter field. However, there are two different velocity script created in which one of them need to add the URL within the Velocity token and this link does not create Malformed Link refer below code
#set( $UTM= ${lead.encryptedID} )
#set( $url = "https://www.google.com" )
#set( $encryptedValue = $esc.url($UTM))
#set( $encryptedURLPrefill = $url + "?UTM=" + $encryptedValue)
${encryptedURLPrefill}
Below OUTPUT URL is working fine
http://www.google.com?UTM=niuwtv%2FX6QbChEVV46iplJEmx02eOtwqJzG%2Fnm9fmYouZwADkHr%2BMg%3D%3D
But, business need is to take out the URL from velocity token and use only UTM parameter via velocity token. In that case, Malformed Link is being created and traced in Email Link Performance report. refer below code
#set($UTM= ${lead.encryptedID})
#set($url = "dummy text")
#set($encryptedValue = $esc.url($UTM))
${encryptedValue}
did anyone faced this issue for Malformed Link Creation using Velocity Script what can be best way to resolve this issue?
malformed link example
https://www.google.com/set(%20$UTM%20=%20$%7Blead.encryptedID%7D%20)
Solved! Go to Solution.
Thanks for sharing that! I’m not referencing any lead token in the link - just the velocity token.
n.b. you shouldn’t use the curly braces here (though it would not cause the behavior you’re describing):
#set( $UTM = ${lead.encryptedID} )
instead do:
#set( $UTM = $lead.encryptedID )
thanks for the details but I am still facing the same issue. In email editor preview the correct value is displayed but as soon as I open the link from my inbox it is not working.
what does the current code look like?
What is the link that you get in your inbox look like (just to confirm the problem hasn't changed along the way)
Cheers
Jo
#set( $UTM = $lead.encryptedID )
#set( $encryptedValue = $esc.url($UTM))
${encryptedValue}
above is the velocity code and inbox URL start with Domain Name/dcn/Marketo encrypted code
and the preview URL in email editor with specific person(jay00031987@xyz.com) based is http://www.google.com?UTM=niuwtv%2FX6QbChEVV46iplJEmx02eOtwqJzG%2Fnm9fmYouZwADkHr%2BMg%3D%3D
and mktNoTok is being used in the hyperlink.
I'm still getting the correct UTM parameter value in both the email preview and the actual email sent from Marketo.
E-mail preview tab
E-mail in the inbox of a test record
On clicking the CTA from E-mail
Are you adding the "?UTM=" directly in the URL editor in Marketo?
Yup! please refer below image
Also, I see the given example for your URL is not converting + sign in %20 but when we use the velocity token it does. it look like you are not using velocity token in the URL. are you using lead token only in UTM?
Thanks for sharing that! I’m not referencing any lead token in the link - just the velocity token.
It look like same approach is working at your system but in my system I am facing issue. does Adobe support can help to sort this issue?
It look like same approach is working at your system but in my system I am facing issue. does Adobe support can help to sort this issue?
Doubtful (though not impossible) that your system is behaving differently.
Earlier you said you’d added class mktNoTok to the link. You want mktNoTrack.
Hey, couple of notes for both the velocity script snippets below:
Script - 1
#set( $UTM= ${lead.encryptedID} ) #set( $url = "https://www.google.com" ) #set( $encryptedValue = $esc.url($UTM)) #set( $encryptedURLPrefill = $url + "?UTM=" + $encryptedValue) ${encryptedURLPrefill}
Below OUTPUT URL is working fine
http://www.google.com?UTM=niuwtv%2FX6QbChEVV46iplJEmx02eOtwqJzG%2Fnm9fmYouZwADkHr%2BMg%3D%3D
The URL added via the above script will not be tracked in Marketo. More on tracking URLs added via velocity here.
Script - 2
#set($UTM= ${lead.encryptedID}) #set($url = "dummy text") #set($encryptedValue = $esc.url($UTM)) ${encryptedValue}
did anyone faced this issue for Malformed Link Creation using Velocity Script what can be best way to resolve this issue?
malformed link example
https://www.google.com/set(%20$UTM%20=%20$%7Blead.encryptedID%7D%20)
You can either output the entire URL (<a> through closing </a>) using the email script - this way you'll be able to track the activities on the URL given that you include the protocol outside of variable in the anchor tag, or use the existing script and include the class="mktNoTrack" in the HTML of your link, however this'll disable the tracking on this link. Also, I don't think you need to set the $url variable here, if you aren't using it anywhere.
Refer this community article.
I had a similar problem last year and this was the solution. I needed to define the text to be linked and output the linked text (not just the link itself) via Velocity.
Hi @Darshil_Shah1 ,
I did the html changes and used class="mktNoTrack" but the link is still not correct it is displaying as same https://www.google.com/set(%20$UTM%20=%20$%7Blead.encryptedID%7D%20)
my first objective is to generate the correct URL and ignoring the fact that if link is outside of velocity scripts it will be not traced in Marketo. However, it can be checked in third party tool like GA.
my first objective is to generate the correct URL and ignoring the fact that if link is outside of velocity scripts it will be not traced in Marketo. However, it can be checked in third party tool like GA.
GA will not help you track Munchkin session activities to the original recipient. Yes, any URL that leads to a page w/GA can be tracked anonymously.
silly question - have you ensured that the encryptedID field is checked in the object tree on the RHS of the script editor?
Cheers
Jo
Yes. It is selected
I'm unable to replicate this at my end! I get the correct UTM params updated in the email and in the browser upon click. The value for the abc UTM parameter is populated from a lead token. Where are you appending the "?UTM=" in the URL? I don't see that in the URL shared by you.
Refer below screenshot you can see in the preview at the bottom the URL is displaying correct value but when email is delivered it is not working as expected in preview section.