Decorate link from a URL type field | Community
Skip to main content
Michael_Florin-2
New Participant
May 11, 2017
Solved

Decorate link from a URL type field

  • May 11, 2017
  • 1 reply
  • 2904 views

Hello!

We have a field in Marketo of the type URL. The values in that field are full URLs, like: timetrade.com/app/....

If I want to bring these URLs into emails using the token like that:

<a href="{{lead.SFDCLeadOwnerTimeTradeURL}}">

that link doesn't get decorated = redirected = tracked. I know, it's because the "" part of the link is in the token and not on the email as it should. Is there any way I can have this link decorated nonetheless?

Thanks!

Michael

Best answer by SanfordWhiteman

Mmm, glad that did it! But emitting the Velocity reference (${urlshort)) directly in the email is not supported (it's an artifact of Marketo's use of Velocity in general, even without userland tokens).

I did mean having the Velocity token emit the whole <a>.  Try it with the three lines directly in the token, then include the {{my.token}} name.

#set( $url = $lead.SFDCLeadOwnerTimeTradeURL )

#set( $urlshort = $url.replace( "https​://", "") )

<a href="http​s://${urlshort}">schedule a time</a>

1 reply

SanfordWhiteman
New Participant
May 11, 2017

You can use Velocity to emit a fully-formed <a> link based on that field and it will be tracked. This is a good/necessary workaround when fields can't be stopped from including a full URL.

Michael_Florin-2
New Participant
May 12, 2017

Thanks Sanford!

Disclaimer up front: I don't really speak Velocity. I'm just a rather oblivious user.

But that said:

<a href="${lead.SFDCLeadOwnerTimeTradeURL}">Just add a date on my calendar</a>

This string from my script token does not return a decorated link. But with "emit a fully-formed <a> link", I suppose you mean something like this:

#set( $url = "${lead.SFDCLeadOwnerTimeTradeURL}" )

#set( $urlshort = $url.replace("", "") )

and putting

<a href="${urlshort}">schedule a time</a>

on the email. That indeed works fine.

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
May 12, 2017

Mmm, glad that did it! But emitting the Velocity reference (${urlshort)) directly in the email is not supported (it's an artifact of Marketo's use of Velocity in general, even without userland tokens).

I did mean having the Velocity token emit the whole <a>.  Try it with the three lines directly in the token, then include the {{my.token}} name.

#set( $url = $lead.SFDCLeadOwnerTimeTradeURL )

#set( $urlshort = $url.replace( "https​://", "") )

<a href="http​s://${urlshort}">schedule a time</a>