AnsweredAssumed Answered

Velocity Script a trackable URL?

Question asked by Adam Glasser on Oct 3, 2018
Latest reply on Oct 5, 2018 by Sanford Whiteman

Currently, we are using velocity scripting within a my.token to pull data from a field within a custom object in Marketo. The data is an order number, which populates a portion of a URL so that when we send a link we can reference a specific order within our database.


The URL looks like this: {{my.Order Number}}


The velocity script for {{my.Order Number}} looks like this:


#if( $pFLOrders_cList && !$pFLOrders_cList.isEmpty() )

#set( $firstItem = $pFLOrders_cList[0] )

#set( $lastItem = $pFLOrders_cList[$math.sub($pFLOrders_cList.size(),1)] )




This is working fine when we are not tracking link clicks, but when I do click the button to track clicks this link stops working when I trigger the email to go out on a test lead. It will however work when I preview the email as that same test lead. I saw in this post…  that this is a known issue, and that we need to velocity script the entire URL. I have been reading through Marketo's developer resources on email scripting, as well as the Velocity User Guide, and am still quite confused about how to write this script.


Does anyone have suggestions on developers who may be interested in taking on a project this small? Or standard velocity code I might be able to use to velocity script this entire URL?



Thank you!