One of the most critical aspects of increasing ROAS from email marketing campaigns is segmenting and personalization. You can succeed in both if your email software has enough information from your website or CMS.
Klaviyo has extensive pre-setup integrations for websites built using popular CMS (like Shopify or woo-commerce). But what if you want to track additional events or have a custom site? In this case, there are two options: set up tasks for the developers or send website events through the server Google Tag Manager.
This guide will show how to use a server GTM container to set up Klaviyo website event tracking.
What is Klaviyo’s website event tracking, and why do you need it?
Klaviyo’s website event tracking allows users to create segments and launch flows depending on a user’s behavior on the site. There are tons of scenarios where you can use Klaviyo’s events, for example – if someone added your product to cart but didn’t buy it yet. You will definitely want to remind them what products are waiting for them.
This is where Klaviyo event tracking comes into the game. To set up a personalized email campaign for cart abandonments, you need first send a custom event from the site that includes product information such as product name, URL, image, etc., of what’s being added to the cart.
You have several ways on how to send website events to Klaviyo:
- Server-side requests
- Server Google Tag Manager container
Klaviyo has detailed instructions on how to use the first two methods, which involve your developers. In this article, we will focus on using server Google Tag Manager container.
The main benefit of using sGTM:
- no developer work is required. All can be done inside the sGTM interface
☝️Note: integration using server GTM will work only if you know a user email. You should send user email for each tag to associate users on your site with users in the Klaviyo database and add required events and parameters.
How to set up Klaviyo website event tracking using server Google Tag Manager
1. Check if you have already installed Google Tag Manager server container.
2. Make sure Google Tag Manager Web container has all the info needed about the user. Perhaps, this data will be in the GTM variables or data layer as you already set up Google Analytics or Facebook tracking inside Google Tag Manager Web container.
3. Send required data from the Web GTM container to the Server container. There are two ways on how to send data to server GTM:
– Data Tag and Data Client. I recommend using Data Tag/Data Client because Data Tag has a built-in feature to store user data. It will help to track Klaviyo events more accurately by storing user email.
4. Add Klaviyo tag to the server container using the server template gallery.
5. Create a new tag in the server container -> Tag type Klaviyo -> Add your Klaviyo Public API key (how to find public API key)
6. Add a variable with a user email -> Select “Event” -> Add event name -> Add event properties you want to send.
7. Add trigger. In my case, this tag triggers on a custom event add to cart, claimed by Data Client.
8. Test the event that you’ve set up. You should see that the Klaviyo tag is triggered in the server container and the event was associated with the Klaviyo contact.
There is no need for custom code or long waiting times for the next release when using the Klaviyo tag for server Google Tag Manager to set up events tracking. The integration allows you built advanced flows and custom emails, plus it’s quick and easy if you are familiar with server-side tracking!