Question

Dynamic URLs and Merge Tags in Images

  • 18 April 2024
  • 3 replies
  • 27 views

Badge

I have a pre-launch referral campaign and I want to attach each person’s unique shareable link to an image that says “refer friends”. Is it possible to to use dynamic URLs  and merge tags in the ‘Link’ section of an image in an email? 


3 replies

Badge +3

Yes!

First, you’ll need to add a custom property to each user’s profile with their unique referral link. In this example, I’ve named the custom property Referral Link:
 

 

Then you can add this code to the Link Address field of your image:

{{ person|lookup:'Referral Link' }}

 

 

Optionally, you can also add a default value in case the subscriber doesn’t have the Referral Link property, like this:

{{ person|lookup:'Referral Link'|default:'https://www.test.com' }}

To verify it’s working, click the Preview & Test button in the top right and search for any profile that has a referral link. In your browser (I’m using Chrome), you should be able to mouse over the image and see the referral link appear underneath. (The kx parameter is blank for now but will be added to the live email to track the subscriber.)

 

You can of course send yourself a few test emails, previewing it as various subscribers, and click the image to verify it takes you the correct URL.

Going forward, if you’re ever unsure of the code you need to insert:

  1. Click the Preview & Test button
  2. Search for a subscriber who has the property you want to use
  3. Scroll down to the subscriber’s custom properties
  4. Click the bold property name to copy the code

 

 

Adrienne

Badge

Super helpful, thank you. 

Badge

For some reason, the merge tag isn’t picking up the referral link. Any suggestions on how to figure out the issue? Our custom property is called “sharingUrl”, which is generated from our third-party referral platform that generates the link, which gets imported to Klaviyo. Thanks in advance. 

Reply