Skip to main content

Personalised images in Klaviyo

Use OKZest with Klaviyo to show each recipient an image with their own details, such as their first name. Klaviyo replaces its personalisation tags for each person when it sends, and OKZest builds the image from those details.

You need: an OKZest account with a saved design that has at least one dynamic text layer, and a Klaviyo account with profiles that hold the details you want to show.

1. Use Klaviyo's personalisation tag in your design​

Klaviyo calls its merge tags personalisation tags and writes them between double curly brackets. For a profile's first name, Klaviyo documents:

DetailKlaviyo tag
First name{{ first_name }}
Last name{{ last_name }}

Klaviyo says tags are case sensitive, so type them exactly as shown. Other profile details, such as a custom property, follow the form {{ person.property_name }}. Klaviyo's guide to the full list is Message personalization reference.

In OKZest:

  1. Open your design and select the dynamic text layer.
  2. In Text settings, enter a short ID, such as first_name.
  3. In Merge tag, enter {{ first_name }}.
  4. Enter Default text, such as friend, then save the design.
Set the fallback in OKZest, not in the tag

Klaviyo can add its own fallback with a filter such as {{ first_name|default:'friend' }}. In an image address that adds quote marks and a pipe character, which is more to go wrong. Keep the tag plain and let OKZest's Default text cover profiles with no first name.

See Merge tags for the full list of formats and the rules for other layer types. If you have not made a design yet, follow the email quickstart first.

2. Copy the image code from OKZest​

  1. In OKZest, select Share.
  2. Under Embed your image, select Copy <img>.
  3. If a yellow Some merge tags are missing box appears, type {{ first_name }} into it and select Save changes, then copy the code again.

The image address in the code looks like this, where first_name is your layer ID:

https://media.okzest.com/img?c=YOUR_COMPANY_ID&i=YOUR_DESIGN_ID&first_name={{ first_name }}

3. Paste it into a Klaviyo HTML block​

Klaviyo's drag-and-drop email editor has an HTML block for custom code. Klaviyo describes it as the place for custom-coded elements, such as countdown timers, and custom CSS.

  1. In Klaviyo, open your campaign or flow email and go to its content editor.
  2. In the sidebar, drag an HTML block into your layout.
  3. Select the block and replace any placeholder code with the <img> tag you copied from OKZest.
  4. Save the email.

Source: Klaviyo: Guide to the email template editor. If you build your template from your own HTML, see How to import a custom HTML template and paste the <img> tag where the image should go.

4. Send a test​

Check the result with Klaviyo's preview or a test send rather than from the editor view.

  1. In the email editor, use the preview option and choose a profile that has a first name.
  2. Send a test email to yourself as well and open it.
  3. Check that the image shows your details. If your own profile has no first name, you will see the default text. Add one and send again to check the personal version.

If it does not work​

  • The image shows the default text for everyone. Check the tag in OKZest matches Klaviyo's exactly, including lower-case letters and the spaces inside the brackets.
  • A broken image appears. Paste the image address into a browser, replacing the tag with a real name such as first_name=Sam. If it loads, the design is fine and the problem is in how the code was pasted.
  • Names with unusual characters look wrong. See Merge tags for how OKZest encodes values, and the troubleshooting page.

What next​