6 Replies Latest reply on Oct 5, 2018 3:41 PM by Sanford Whiteman

    Velocity Script a trackable URL?

    Adam Glasser

      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:  http://printingforless1.com/ps/Survey/NPS?order= {{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)] )

      #end

      $lastItem.orderNumber

       


      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 https://nation.marketo.com/message/191133-re-marketo-tracking-links-breaking-when-velocity-script-tokens-used#comment-19…  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!

      Adam