Guidance Needed: Using Rep Code from a Marketo Field to make it trackable
Hi Team,
We have a field in Marketo that stores a Rep Apply Link, which contains a unique rep code. Our goal is to extract just that unique rep code and use it within other links so that when someone clicks or applies using that link, we can identify which rep they are associated with.
For example, we want to end up with a link structure like:
http://google.com/?rep={{rep-code}}
I have a few questions:
-
Since the rep code would need to be dynamically generated per rep using a Velocity script, can we reference the resulting My Token directly in the email link? Or does the entire anchor tag need to be handled within Velocity to ensure the link both works correctly and remains trackable in Marketo? Like the custom object think we discussed a while ago ?
-
For clarity, we’re also looking to understand how to extract just a specific portion of a field value. For example:
-
Apply Field value: https://www.abc.com/apply?rep=XXXXX
-
Desired output: https://www.yahoo.com?rep=XXXXX
Essentially, we want to pull only the rep code (
XXXXX) from the existing field and append it to different base URLs as needed. -
-
Based on best practices, should the full setup—including the link and anchor tags—be handled within the Velocity script, or is it recommended to keep the Velocity logic limited to generating the rep code and then reference it in the email content?
This is primarily to ensure the links are both functional and trackable, and that we can reliably capture rep attribution in activity logs.
Any guidance or recommended approach would be greatly appreciated.
Thanks in advance for your help,
Akshat