Hyperlink token within a tokenized URL | Community
Skip to main content
Tom_Liolios4
New Participant
June 2, 2022
Question

Hyperlink token within a tokenized URL

  • June 2, 2022
  • 2 replies
  • 5906 views

Hello!

 

I am trying to add a hyperlink to a text token, while that text token is already used to generate a hyperlink for a calendar item.

 

We add the following tokenized URL to our Marketo landing page so people can add our events to their Google calendar:

https://ics.agical.io/alt_sep/?subject={{my.calendar-title}};description={{my.calendar-description}};dtstart={{my.webinar-date-ISO}}T{{my.webinar-time-ISO-start}}:00z;dtend={{my.webinar-date-ISO}}T{{my.webinar-time-ISO-end}}:00z;organizer={{my.webinar-invitor-email-address}};location={{my.calendar-location}};format=gcal;preencoded=true

 

In this tokenized URL, we use individual text tokens that are populated when a program is created.

 

However, I would really like to add a hyperlink to the text token {{my.calendar-description}}. That way, people that open the calendar item will be able to right away click on a hyperlink to e.g. attend our webinar.

 

Is it possible to add a hyperlink to the text token {{my.calendar-description}}, and have that token then be used in the overall tokenized URL to create the calendar link?

 

Thank you for your insights!

 

Best,

Tom

 

2 replies

New Participant
June 2, 2022

Hi @tom_liolios4 ,

 

Ideally for the calendar token we don't need to put in hyperlink, we can direct use this token in the text. Because it's already having URL, so if we use this token in hyperlink then it won't work.

 

Let me know in case of any concerns.

 

Thanks!

Jasbir

SanfordWhiteman
New Participant
June 2, 2022

Ideally for the calendar token we don't need to put in hyperlink, we can direct use this token in the text. Because it's already having URL, so if we use this token in hyperlink then it won't work.

Not sure exactly what you mean here, but if the data is properly encoded it’s perfectly possible to pass a URL inside another URL (or a URL inside a URL inside a URL).

Darshil_Shah1
Community Manager
June 2, 2022

Yes that's possible! You'd need to URI encode the anchor tag (<a> through </a>) before adding it to the text token. 

 

Instead of setting {{my.calendar-description}}

 

This is our long event description. Please do attend our webinar by clicking <a href="http://www.example.com/" target="_blank">here</a>

 

URI encode <a> through </a>, and set it as - 

 

This is our long event description. Please do attend our webinar by clicking %3Ca%20href%3D%22http%3A%2F%2Fwww.example.com%2F%22%20target%3D%22_blank%22%3Ehere%3C%2Fa%3E

 

You can then normally reference the {{my.calendar-description}} token in the URL.

 

Hope this helps!

Tom_Liolios4
New Participant
June 2, 2022

Hi @Darshil_Shah1  

 

Many thanks for your advice! I got it to work for the Google calendar link.

 

For the Outlook calendar link, it displays the calendar description in an odd way. Would there need to be a different URI encode for Outlook calendar links?

 

ics.agical.io/alt_sep/?subject={{my.calendar-title}};description={{my.calendar-description}};dtstart={{my.event-date-start-ISO}}T{{my.event-time-ISO-start}}:00z;dtend={{my.event-date-end-ISO}}T{{my.event-time-ISO-end}}:00z;organizer={{my.event-invitor-email-address}};location={{my.calendar-location}};preencoded=true

Darshil_Shah1
Community Manager
June 2, 2022

I see what you're saying! In the outlook the anchor tag isn't getting parsed unlike the google calendar (outlook ics file snapshot below for ref.). 

I doubt if this can be fixed, as Outlook is always notorious with the HTML (and there is only so much we can code in the ics file link to ensure the hyperlink within it works everywhere). Tagging @sanfordwhiteman to check if he can help in suggesting a way so that the hyperlinks in the long description work in the outlook as well. Thank you!