I am looking to create a velocity script that assigns token value by page segmentation instead of lead segmentation. So for example, I want to assign a different token value based on language segment. The reason I do not want to use lead segmentation values is not all leads are cookied and may not have values.
How can I segment dynamical in velocity script by page segmentation?
Solved! Go to Solution.
It’s not clear why you’d need Velocity to insert an already-URL-safe* {{lead.token}} into a URL, but if you do want to use Velocity, just check off the field on the right-hand-side of Script Editor and drag it to the canvas
* the words “english” and “spanish” only use nonreserved ASCII letters, so they can go right in a URL
Can you explain your goals at the business level so as not to get bogged down by an XY Problem?
Page segmentations (i.e. runtime segmentations with the segmentname=segmentvalue in the URL) don’t naturally create anything that’s visible in Marketo.
You can detect the query string in a Visited Web Page trigger and update a lead field accordingly, then use that lead field in Velocity.
But I’m not really clear about your goals.
I want to insert a different link based on landing page language.
For instance, ?language=english I want to show english link
For, ?language=spanish I want to show spanish link
Want to do this via velocity token, not update manually
@mkmarketo1, insert a different link where? An email CTA?
It’s not clear why you’d need Velocity to insert an already-URL-safe* {{lead.token}} into a URL, but if you do want to use Velocity, just check off the field on the right-hand-side of Script Editor and drag it to the canvas
* the words “english” and “spanish” only use nonreserved ASCII letters, so they can go right in a URL