In this category Newsletters

Newsletters

Klaviyo

6 min read

On this page

With Klaviyo you can target emails at your (potential) customers based both on what they have shown an interest in and on what they have already bought.

Many people will weigh it up against Mailchimp. See a comparison here:

Klaviyo vs Mailchimp | Best email marketing platform for ecommerce 2022Play video: Klaviyo vs Mailchimp | Best email marketing platform for ecommerce 2022 (opens YouTube)

Setting up the Klaviyo integration

To use the Klaviyo integration, you need the Enterprise plan. Contact support to upgrade.

There are 3 parts to the integration with Klaviyo

  1. Product feed
  2. Front-end tracking of visitors’ actions
  3. Server-side tracking of orders

1: Product feed

You create the product feed via the Tools menu item

Screenshot: 1: Product feed

Add it as an XML product feed. See also our general guide to product feeds here.

As the template, we suggest using this one:

<?xml version="1.0"?>
    <Products>
        {% for product in products %}
            <Product>
                <id>{{ product.article_id }}</id>
                <title>{{ product.title }}</title>
                <description>{{ product.description }}</description>
                <link>{{ product.link }}</link>
                <image_link>{{ product.image_link }}</image_link>
                <inventory_quantity>{{ product.quantity }}</inventory_quantity>
                <categories>{{ product.category }}</categories>
                <price>{{ product.price }}</price>
                <sale_price>{{ product.sale_price }}</sale_price>
            </Product>
        {% endfor %}
    </Products>

2: Front-end tracking of visitors’ actions

You set up front-end tracking via Other integrations:

Screenshot: 2: Front-end tracking of visitors’ actions

Click the Add new Other integrations button at the bottom of the page.

We have made a standard tracking script for Klaviyo that you can use as a starting point or as it is – just click the button

Screenshot: 2: Front-end tracking of visitors’ actions (opens a larger image)

Fill in your Your Public API Key / Site ID and click OK

Screenshot: 2: Front-end tracking of visitors’ actions (opens a larger image)

Click Save at the bottom, and your front-end tracking script is ready.

Here is what front-end tracking consists of, according to Klaviyo:

Screenshot: 2: Front-end tracking of visitors’ actions (opens a larger image)

3: Server-side tracking of orders

Server-side tracking sends order information to Klaviyo via the API. This part requires an Enterprise or Server licence for your Golden Planet online shop.

You’ll find it under the Integration menu item

Screenshot: 3: Server-side tracking of orders (opens a larger image)

Here you enter your Klaviyo API key and Site ID. You also need to state which order status you use for cancelled orders and for completed (dispatched) orders – see also more about order status setup here.

Screenshot: 3: Server-side tracking of orders (opens a larger image)

Here is what their server-side tracking consists of, according to Klaviyo:

Screenshot: 3: Server-side tracking of orders (opens a larger image)

4: Synchronising subscribers

Customers who sign up for the newsletter in your online shop (e.g. via My account or when they complete an order) can be transferred to a list in Klaviyo.

Sign-ups to the same list are also transferred from Klaviyo to the online shop.

Unsubscribes in the online shop are likewise removed from that specific list in Klaviyo, but not from any other lists in Klaviyo. So, as a rule, you should have an unsubscribe link in Klaviyo on everything you send from there.

Klaviyo has no standard way of removing unsubscribed contacts via a webhook. So unsubscribes are not carried over to the online shop. That doesn’t matter as long as you only send from a list in Klaviyo, but it is important if you want to send from other systems or decide to switch to something else (in that case, lists must be based on an export from Klaviyo and not from the online shop – or the online shop must be updated from the lists in Klaviyo).

Insert the list ID

Go to Lists & Segments in your Klaviyo and click List settings for your list of newsletter recipients

Screenshot: Insert the list ID (opens a larger image)

Copy the list ID at the top – you’ll find it here

Screenshot: Insert the list ID (opens a larger image)

Paste it into the Klaviyo settings for your Golden Planet online shop

Screenshot: Insert the list ID (opens a larger image)

Remember to save the changes.

Create a flow in Klaviyo

Go to Flows in your Klaviyo and click Create Flow

Screenshot: Create a flow in Klaviyo (opens a larger image)

Then click Create From Scratch

Screenshot: Create a flow in Klaviyo (opens a larger image)

Give your flow a name and click Create Flow

Screenshot: Create a flow in Klaviyo (opens a larger image)

Click the List trigger setup

Screenshot: Create a flow in Klaviyo (opens a larger image)

Choose the list with your newsletter recipients (the list you copied the list ID from earlier)

Screenshot: Create a flow in Klaviyo (opens a larger image)

Click Done

Screenshot: Create a flow in Klaviyo (opens a larger image)

Now add a Webhook to the trigger by dragging it with your mouse and dropping it on the plus sign

Screenshot: Create a flow in Klaviyo (opens a larger image)

Enter the destination URL as the web address of your shop + /admin/newsletter/subscribers/pingback-subscribe/klaviyo

If your online shop is at https://webshopdemo.dk, the full URL is https://webshopdemo.dk/admin/newsletter/subscribers/pingback-subscribe/klaviyo

Screenshot: Create a flow in Klaviyo (opens a larger image)

Under Headers, first fill in the Key field with “Authorization”

Screenshot: Create a flow in Klaviyo (opens a larger image)

What goes in Value you’ll find in your online shop, where you go to the list of subscribers

Screenshot: Create a flow in Klaviyo (opens a larger image)

At the bottom of the page, copy the authorisation code shown in highlighted text

Screenshot: Create a flow in Klaviyo (opens a larger image)

Paste it in as Value

Screenshot: Create a flow in Klaviyo (opens a larger image)

Under JSON BODY, remove what is there and insert this piece of code:

{

"email": "{{ person.email }}",

"first": "{{ person.first_name|default:'' }}",

"last": "{{ person.last_name|default:'' }}"

}

When filled in, it will look like this

Screenshot: Create a flow in Klaviyo (opens a larger image)

Save the setup by clicking Save

Your flow is now ready, and you can start it by changing its status to Live

Screenshot: Create a flow in Klaviyo (opens a larger image)

If the online shop shouldn’t send newsletter confirmation and/or welcome emails

In the newsletter settings in your online shop

Screenshot: If the online shop shouldn’t send newsletter confirmation and/or welcome emails (opens a larger image)

you can switch off the online shop’s sign-up confirmation email and/or welcome email, if you want to run that part from Klaviyo too

Screenshot: If the online shop shouldn’t send newsletter confirmation and/or welcome emails (opens a larger image)

Transfer existing subscribers from the online shop to Klaviyo

If you have active newsletter recipients in your online shop before Klaviyo is connected, you can transfer them by exporting/importing a CSV file.

Export subscribers from the online shop

Go to Export to file

Screenshot: Export subscribers from the online shop (opens a larger image)

Choose Subscribers and then Active subscribers

Screenshot: Export subscribers from the online shop (opens a larger image)

Click the Export to file button

When the export is finished, click the file name to download it. See also more here about exporting files.

Please note that the online shop exports the full name. If you want to import the first name on its own, split that column and take out the first name before you import.

Import subscribers into Klaviyo

Go to Lists & Segments

Screenshot: Import subscribers into Klaviyo (opens a larger image)

and click the name of your list.

Then click Manage list and, under it, Import contacts

Screenshot: Import subscribers into Klaviyo (opens a larger image)

Carry out the import by matching the email and name columns, plus any other columns you want. You’ll find Klaviyo’s guide to importing here. (opens in a new tab)

Abandoned basket integration

With Klaviyo you can send an email to people who have visited your online shop and put something in the basket – but not completed an order.

A reminder that they may have forgotten to complete the order can be sent automatically some time after they were last seen in the shop. This reminder is sent to those who have signed up for the newsletter and for emails from your online shop and who, of course, were recognised by Klaviyo during the visit.

For this to work, the ID of the basket in your online shop has to be sent. You do this by adding a parameter for it, like this:

Go to Integration > Other integrations

Screenshot: Abandoned basket integration (opens a larger image)

Find your Klaviyo tracking in the list and click Edit next to it.

Find this place in the tracking code (by default it’s at the end):

Screenshot: Abandoned basket integration (opens a larger image)

Now insert this line

"BasketId": params.eventTrackingData.linkToCart,

so that it becomes this instead

Screenshot: Abandoned basket integration (opens a larger image)

Click Save at the bottom.

That was the online shop part – you set up the rest in Klaviyo.

Read more about how to do the setup in Klaviyo here (opens in a new tab)