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?
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:
- Click the Preview & Test button
- Search for a subscriber who has the property you want to use
- Scroll down to the subscriber’s custom properties
- Click the bold property name to copy the code
Adrienne
Super helpful, thank you.
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.
Hi there
Do you mind sharing how exactly and why you’re using merge tags?
Is the URL live and correct when you paste it into the URL?
-Taylor
Hi Taylor, I wanted to include merge tags so folks could click on a button in the email and be directed to their unique referral link.
Reply
Log in to the Community
Use your Klaviyo credentials
Log in with Klaviyo
Use your Klaviyo credentials
Log in with KlaviyoEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.