You will learn

Learn how to use anchor links to target your sign-up forms, or in email and SMS messages to direct visitors to a particular section of a webpage.

Anchor links are an easy way to create a personalized on-site experience for your customers coming from different emails, advertisements, or even in-person events. Use different anchor links in messages sent to different lists or segments to show relevant forms on your website. Use UTM parameters to measure which messages drive website traffic. For more information on using UTM parameters, head to our article on UTM Tracking in Klaviyo.

How to create an anchor link

To create an anchor link, add a # symbol followed by a short, descriptive name to the end of a webpage URL. For instance, if you want a pop-up to appear when someone clicks a link in your email, indicating they are interested in hearing about a new product you are releasing, you can make an anchor link that looks like the following.

https://www.example.com/#newproduct

Replace https://www.example.com/ with the page on your website, then add the full URL to your messages. Use the anchor name to set up form targeting as described below.

When someone opens this link, they load the same webpage (i.e., https://www.example.com/ in the example above), with #newproduct still in the URL. Optional: You can add the HTML tag <a id="newproduct"></a> to your webpage's code (replace newproduct with your anchor name) if you'd like people who click the anchor link to be directed to a specific location within the page.

How to add anchor links in messages

To use your anchor links in messages, add a URL like the one created above to your emails and SMS messages.

Email

To add an anchor link in an email:

  1. Add a text, image, or button block to your template.
  2. For an image or button block, paste the full URL with the anchor into Link address in the block’s settings. For a text block, highlight the text to link, click the link icon, paste the full URL into URL, then click Apply.
  3. For a saved template or flow email, click Exit. For a campaign email, click Next in the step-by-step editor or Save and return in the campaign canvas.
Button with anchor link
Button with anchor link

If you want to track where a person clicks within your email to use later in segmentation, follow our article on using buttons to collect information about your recipients.

SMS

To add an anchor link in an SMS message, paste in a URL with your anchor link in the SMS editor. Note that if you choose to shorten your link, the anchor link will still work.

SMS with anchor link
SMS with anchor link

Using anchor links with sign-up forms

After you’ve created a way for your customers to reach your anchor link, you can use sign-up forms to customize the on-site content for each browser so that your brand seems more human.

Before you begin, make sure Klaviyo’s onsite tracking (Klaviyo.js) is installed on your website so the form can appear.

A matching URL does not override the form’s other targeting and display settings. Review Audience to make sure your intended audience is included, especially if you are sending the link to existing subscribers. Learn more about targeting and behavior settings.

Continuing with the example above, if someone clicks the button in the email or the link in the SMS, you can show them a full page sign-up form to receive information about a product release. Configure the form to appear on URLs containing #newproduct. This rule applies to anyone who visits a matching URL, including people who open it directly. To set it up:

  1. From the sign-up form builder, click Targeting & behavior.
  2. On the Display tab, set Timing to Immediately if you want the form to appear when visitors arrive. Review Frequency and Devices so those settings fit your intended audience.
  3. Select the Targeting tab.
  4. Under URLs, turn on Only show on certain URLs.
  5. Select Containing and enter your anchor, including the # symbol (e.g., #newproduct).
  6. Test your form before setting it live. When you’re ready, click Publish or schedule, select Publish now, then click Publish now to confirm.
Targeting form for anchor link
Targeting form for anchor link

Open the full anchor URL on your website and check that the form appears for your intended audience. Come back to the form to make sure it’s performing well.

Additional resources

Was this article helpful?
Use this form only for article feedback. Learn how to contact support.

Explore more from Klaviyo

Community
Connect with peers, partners, and Klaviyo experts to find inspiration, share insights, and get answers to all of your questions.
Partners
Hire a Klaviyo-certified expert to help you with a specific task, or for ongoing marketing management.
Support

Access support through your account.

Email support (free trial and paid accounts) Available 24/7

Chat/virtual assistance
Availability varies by location and plan type