In custom objects list, capturing the URL as a string data type with https:// but when adding UTM parameters the in the link UTM details are not captured. And I came to know that need to strip out the https:// part from before importing either in custom objects or in email velocity script. Can anyone have the email velocity script implemented to strip out the URL https:// ?
kindly, share the any reference link to use $params
Solved! Go to Solution.
You don't need to worry about that, it's not the problem (and won't solve the problem).
You do need to remove the protocol from non-Velocity tokens (Text {{my.tokens}}, Lead fields that become {{lead.tokens}}, etc.) but that's a different issue.
Your question isn't quite clear.
Removing the protocol from the URL is indeed preferable. But that doesn't have anything to do with query parameters. If you set a CO field to a full URL w/query, then removing the protocol doesn't change whether you can access the query string or not.
Please explain more precisely what you've done, what behavior you observed, and what behavior you expected.
Hi Sanford,
I am starting my first code in VTL and have been assigned a scenario only. So, I am pretty much new and still learning.
Scenario:
In custom objects list, field-A has value as https://www.abc.com/product.png as a product image and field-B has value https://www.abc.com/productlink.html as product link and field-C has product name and field-D date and time. and other fields are used to store additional data.
Additionally, I have html block to use for field A,B,C
My approach before starting code:
Sorting custom objects list with field-D #set( $sortedList = $sorter.sort($customObjList,"date:desc") )
but after that, I am missing logic to use html block for field A,B,C because I have to add UTM tags as parameter in field-B so that it is traceable in google analytics. ?utm_tag=productlink so I am not sure whether to strip out the URL or not.
So, I am looking for better approach here only.
You don't need to strip the protocol if you're only going to output a single <a> link in the final email. You can just append the query string to the initial URL.
If you're outputting multiple links from the list (as opposed to filtering down to just one) then you need to do much more work, well beyond stripping the proto.
So, If I start using #macro coding with loop conditions after sorting the url based on date filter there would be no issue. For example, as I have html block for three products A, B, C.
1. first I will sort the url for product A and use html block A. I will use only one utm tag i.e. for product link A only.
2. I will repeat same coding for Product B and C and will use one utm tag in each product. So, I will not get any issue in URL.
So, If I start using #macro coding with loop conditions after sorting the url based on date filter there would be no issue. For example, as I have html block for three products A, B, C.
1. first I will sort the url for product A and use html block A. I will use only one utm tag i.e. for product link A only.
2. I will repeat same coding for Product B and C and will use one utm tag in each product. So, I will not get any issue in URL.
I don't know what #macro you're building.
But you will have issues if you output more than one <a> from Velocity unless you disable tracking on all links (class="mktNoTrack"). See my blog post titled "Multiple Marketo-tracked links in Velocity."
I have found your article https://blog.teknkl.com/multiple-marketo-tracked-links-in-velocity/ but I can see you are not using https:// in VTL token but do you have written any additional blog to strip out url too?
You don't need to worry about that, it's not the problem (and won't solve the problem).
You do need to remove the protocol from non-Velocity tokens (Text {{my.tokens}}, Lead fields that become {{lead.tokens}}, etc.) but that's a different issue.