Personalized value in URL | Community
Skip to main content
New Participant
December 6, 2023
Solved

Personalized value in URL

  • December 6, 2023
  • 1 reply
  • 2142 views

Hi ,

 

Hope all are doing well.

 

We've been tasked with personalizing the order ID within a URL. I've successfully used a script to personalize the order ID, and it's updating correctly. However, when I include this token within a URL, the URL breaks. URL doesn't work as expected and displays the script within the link.

 

In the email template, I've hardcoded the https:// part, while the rest of the URL and the personalization are stored in a token. This token, containing the personalized information, is then appended to the https:// portion. 

However, when I included the https:// part directly in the script and used the token within the mailer, the URL worked smoothly. Unfortunately, that particular link lacked trackability.

 

Script :

 

#set($myProtectcode = $lead.protectedCodes_c) #if($myProtectcode.contains(",")) #set($values = $myProtectcode.split(",")) #set($firstValue = $values.get(0)) #set($dynamiclink="xyz.html?Oid=$firstValue&src=email") $dynamiclink #else #set($dynamiclinknew="xyz.html?Oid=$myProtectcode&src=email") $dynamiclinknew

 

 

Kindly help.

 

Thanks & Regards,

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

The code is redundant, you can split regardless of whether the delimiter exists.

#set( $myProtectcode = $lead.protectedCodes_c ) #set( $values = $myProtectcode.split(",") ) #set( $firstValue = $values.get(0) ) #set( $trimmedvalue = $firstValue.trim() ) <a href="https://abc.adobeaemcloud.com/in/en/forms/nps-form.html?Oid=$trimmedvalue&src=email" target="_blank"><img src="https://abc/images/banner.jpg?version=1" style="display: block !important; margin: 0 auto !important;" class="responsive-image1"></a>

1 reply

SanfordWhiteman
New Participant
December 6, 2023

You should be outputting the entire link, from <a> to </a>, from the code. (This is discussed in many past threads!)

New Participant
December 7, 2023

@sanfordwhiteman 

 

Thanks for the reply.

 

I attempted the script as per your suggestion, passing the entire <a> tag. Now its redirecting the URL but without personalizing the Order id value. It's transferring "Oid=$trimmedvalue" directly as it is in the URL.

 

 

#set($myProtectcode = $lead.protectedCodes_c) #if($myProtectcode.contains(",")) #set($values = $myProtectcode.split(",")) #set($firstValue = $values.get(0)) #set($trimmedvalue = $firstValue.trim()) <a href="https://abc.adobeaemcloud.com/in/en/forms/nps-form.html?Oid=$trimmedvalue&src=email" target="_blank"><img src="https://abc/images/banner.jpg?version=1" style="display: block !important; margin: 0 auto !important;" class="responsive-image1"></a> #else <a href="https://abc.adobeaemcloud.com/in/en/forms/nps-form.html?Oid=$myProtectcode&src=email" target="_blank"><img src="https://abc/images/banner.jpg?version=1" style="display: block !important; margin: 0 auto !important;" class="responsive-image1"></a> #end

 

 

 

Please advise.

 

Thanks & Regards,

 

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
December 7, 2023

The code is redundant, you can split regardless of whether the delimiter exists.

#set( $myProtectcode = $lead.protectedCodes_c ) #set( $values = $myProtectcode.split(",") ) #set( $firstValue = $values.get(0) ) #set( $trimmedvalue = $firstValue.trim() ) <a href="https://abc.adobeaemcloud.com/in/en/forms/nps-form.html?Oid=$trimmedvalue&src=email" target="_blank"><img src="https://abc/images/banner.jpg?version=1" style="display: block !important; margin: 0 auto !important;" class="responsive-image1"></a>