Stape
Search
Contact salesTry for free

Set up Klaviyo website event tracking using server Google Tag Manager

Ira Holubovska

Ira Holubovska

Author
Updated
Jul 14, 2025
Published
May 8, 2021

Klaviyo is a marketing platform built for ecommerce businesses that want to use their customer data to send smarter emails and texts. It helps brands create personalized campaigns based on real behavior – like browsing activity, purchases, or engagement – so they can drive more sales and build stronger relationships. With Klaviyo, companies can automate key messages, track performance, and grow their audience without relying on guesswork.

What is Klaviyo server-side tracking?

Klaviyo server-side tracking is a method of sending website event data – such as product views, cart additions, and purchases – directly from a server to Klaviyo’s API, bypassing the browser. This setup is typically implemented using server-side Google Tag Manager (sGTM) and platforms like Stape. By handling data on the server, businesses avoid issues caused by browser limitations, ad blockers, and cookie restrictions, ensuring that key user actions are reliably captured and sent to Klaviyo.

Unlike client-side tracking, which relies on JavaScript running in the user’s browser, server-side tracking allows for greater control over what data is sent and when. It improves event accuracy, enhances attribution, and supports better compliance with data privacy regulations. With Stape’s server-side Klaviyo tag, brands can track events without depending on Klaviyo.js, reduce frontend script load, and maintain clean, consistent data flow into their Klaviyo account.

What is Klaviyo’s website event tracking?

Klaviyo’s website event tracking allows you to create segments and launch automated flows based on how users behave on your site. There are many use cases – for example, if someone adds a product to their cart but doesn’t complete the purchase, you’ll want to remind them what they left behind. That’s where Klaviyo’s event tracking comes in. To trigger a personalized email for abandoned carts, you first need to send a custom event from your site that includes key product details – such as the product name, URL, image, and more. There are several ways to send website events to Klaviyo: JavaScript requests, server-side requests, or via a server Google Tag Manager container. 

Why do you need it?

Klaviyo’s website event tracking is essential for delivering personalized, behavior-based marketing that drives revenue. By capturing user actions – like product views, add-to-cart events, and purchases – you can trigger automated emails or SMS messages tailored to where each customer is in their journey. This makes your marketing more relevant, timely, and effective.

Without proper event tracking, you miss out on opportunities to recover abandoned carts, re-engage inactive users, or recommend products based on browsing behavior. Server-side tracking via sGTM ensures this data is collected reliably, even when browser-based tracking is blocked, helping you maintain performance and improve marketing results.

Benefits of Klaviyo server-side tracking

1. Improved data accuracy. Server-side tracking bypasses browser limitations, ad blockers, and cookie restrictions – ensuring that important events like purchases or cart updates are reliably captured and sent to Klaviyo.

2. Better performance. Offloading tracking logic from the browser to the server reduces the impact on page load times. Unlike Klaviyo’s JavaScript library, which can be heavy, server-side tracking improves site speed and user experience.

3. Enhanced attribution. Accurate, uninterrupted event tracking helps Klaviyo correctly attribute revenue, engagement, and other actions to specific campaigns – even when client-side tracking fails.

4. Easier compliance & control. Server-side setups allow you to manage what data is collected, stored, and sent, making it easier to comply with privacy regulations like GDPR or CCPA.

5. No developer required (with sGTM). Using tools like Stape with server Google Tag Manager, you can implement server-side tracking without writing code. Everything is managed through the sGTM interface.

Events you can track in Klaviyo

Event NameTypeDescription
Viewed ProductEcommerceTriggered when a user views a product page. Used for product recommendations.
Added to CartEcommerceFires when a user adds an item to their cart. Enables abandoned cart flows.
Started CheckoutEcommerceTracks the start of the checkout process. Used for checkout reminders.
Placed OrderEcommerceCaptures when an order is completed. Triggers confirmation and post-purchase flows.
Fulfilled OrderEcommerceIndicates an order has been shipped or delivered. Used for shipping updates.
Cancelled OrderEcommerceMarks when a user cancels an order. Useful for customer recovery or feedback.
Opened EmailEngagementLogged when a Klaviyo email is opened (via tracking pixel).
Clicked EmailEngagementCaptures when a link in an email is clicked. Great for engagement segments.
Signed UpCustomTracks account or newsletter signups. Useful for welcome flows.
Subscribed to SMSCustomMarks user opt-in for SMS marketing.
Visited Pricing PageCustomTracks visits to key pages like pricing or features. Often used in SaaS flows.
Completed SurveyCustomCaptures post-purchase feedback or satisfaction surveys.
Watched VideoCustomLogs engagement with video content (e.g., product or onboarding videos).

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 your 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. We 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 Private API key (how to find private API key).

6. Add a variable with a user email ➡️  Select “Event” ➡️ Add event name ➡️ Add event properties you want to send. 

Klaviyo tag - Stape
Klaviyo tag - Stape

7. Add trigger. In our case, this tag triggers on a custom event add to cart, claimed by Data Client. 

Klaviyo trigger configuration
Klaviyo trigger configuration

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. 

Conclusion

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 to build advanced flows and custom emails, plus it’s quick and easy if you are familiar with server-side tracking!

author

Ira Holubovska

Author

Ira has 10+ years of digital marketing experience, with the last 5 focused on server-side tracking. She understands how and when it works across various digital marketing scenarios.

Comments

Try Stape for all things server-sideright now!