How to use links to collect information about your recipients

read
Last updated at:

You will learn

Learn how to build email templates that include buttons to collect information about your subscribers and then redirect them to another URL.

This process is not currently supported in SMS/MMS messages.

Use cases for collecting information via links

In Klaviyo, you can use links or buttons to collect information automatically from email recipients. For example:

  • In your newsletter campaigns, add buttons that let users specify how many times a week they want to receive emails from you
  • In a thank you email to a new customer, prompt the recipient to update profile details such as gender
  • In a winback email, prompt a customer to choose the category of products they are most interested in learning more about

It is also possible to update a profile property and bring subscribers to a manage preference page, where they can submit additional information. This requires configuring the appropriate manage preferences page in advance. For more information, check out our article on Template Tags and Variable Syntax.

Add buttons or links that update profile properties

Note that when you add a button or link that can update a profile property, recipients can only select one value. If they already have a value for the property set, their selection will overwrite the existing value. 

When using the code snippets provided below, make sure to use straight quotes (') rather than curly quotes (‘) to ensure the code renders correctly. This can be achieved by copying the code below and pasting it directly into your template using the "Paste as Plain Text" function (Ctrl+Shift+V or Cmd+Shift+V). 

Buttons

  1. Head to the email template you want to use
  2. Add a button to the email template
  3. Click on the button where you want to add this feature
  4. Navigate to the Block tab
  5. Enter the following into the Link URL section
    {% update_property_link 'profile_property' 'property_value' 'redirect_link' %}
  6. Change each section of the code to reflect:
    • 'profile_property': the profile property that you'd like to update or create; for example, favorite_color

    • 'property_value': the value that the particular button corresponds to; for example, blue

    • 'redirect_link': the URL that you want them to redirect them to after they click the button

Only standard URLs (i.e., formatted as https://www.klaviyo.com) are supported. This code will work anywhere you'd normally add a link. The property value should be text or a number for best results. Note that if this property is already set for a particular recipient, it will be overwritten when they click the button. 

Linked text

  1. Navigate to the email template you want to use
  2. Highlight the text you'd like to link
  3. Click the hyperlink button in the text editor
  4. Paste the code into the link field
  5. Change the Protocol field to <other>

The URL modal shown when linking text in a text block

 

Example of using links to collect information

Let's say that we want to collect dessert preference information from our subscribers by asking them if they prefer cake or pie.

To create this survey, we must:

  1. Set the 'profile_property' to dessertsurvey
  2. Change the 'property_value' to cake
  3. Make the link redirect to a thank you page

In this case, our code would look like the following.

{% update_property_link 'dessertsurvey' 'cake' 'http://janes-test-store.myklpages.com/p/survey_results' %}

Whenever someone clicks the 'cake' button, it will update the 'dessertsurvey' profile property to 'cake,' and then go to a thank you landing page you create (i.e., http://janes-test-store.myklpages.com/p/survey_results in the example above).
In Klaviyo's template editor, a Cake button uses the update profile property code in the URL field

Now that we've collected data from our customers, we can use it in emails. This data is stored just like a regular customer property, and can be used to create segments that use these properties as conditions in the definition, split flows by different properties, and personalize messages using this data.

Review your results 

Once someone clicks an update property link, their response is stored on their profile. You can navigate to a profile to see an individual’s response, or you can create a segment to identify everyone that clicked a specific option. 

View individual results

To see which option someone selected on their profile: 

  1. Search for a profile in Klaviyo using an email address or name 
  2. Click a profile from the results to view all details 
  3. Scroll down to the Information section of the profile 
  4. Under Custom Properties, find the profile property set in the update property link (“dessertsurvey” in the example above)
  5. Note the property’s value (e.g., “cake”)
    In a profile's custom properties, the dessertsurvey property is set to cake

Create a segment based on answers

To create a segment of all profiles who clicked an update profile property link or button: 

  1. Navigate to the Lists & Segments page 
  2. Click Create List / Segment, then click Segment
  3. In the Dimension field, select your profile property, and in the Dimension value field, add your property value
    A segment definition for all users who selected cake
  4. Finally, click Create Segment to generate a segment of everyone who clicked your update property link/button

Additional resources

x
Was this article helpful?
553 out of 770 found this helpful