Klaviyo x Google Tag Manager: The Complete Integration Playbook (2025)

Blog

April 11, 2025

Klaviyo x Google Tag Manager: The Complete Integration Playbook (2025)

Blog

April 11, 2025

Klaviyo x Google Tag Manager: The Complete Integration Playbook (2025)

Blog

April 11, 2025

Unlock deeper customer insights with Klaviyo and Google Tag Manager. Track every click, form, and product view—then turn that behaviour into automated flows that boost retention and revenue.

Imagine knowing exactly what your customers are doing on your website—every product they view, every button they click, every form they submit. Now imagine turning those actions into personalised emails that boost your sales. That’s the power of pairing Klaviyo with Google Tag Manager (GTM). 

This guide walks you through the setup, step by step, so you can start tracking like a pro. Whether you run a direct-to-consumer (DTC) brand, a non-Shopify store, or just want more control over your data, this playbook is for you.

How Klaviyo and Google Tag Manager Work Together

What is Google Tag Manager (GTM)?

GTM is a free tool from Google that manages tracking codes on your website. It tracks browser-side events—like what pages people visit or what buttons they click—and sends that info wherever you want, like Klaviyo. 

The best part? You don’t need a developer to set it up. It’s a game-changer for marketers who want to dig into data without waiting on tech support. For example, you can add tracking for a “Buy Now” button in minutes, all from GTM’s dashboard.

How Klaviyo and GTM Work Together

Using Google Tag Manager (GTM) with Klaviyo gives you powerful, flexible event tracking, without needing heavy dev work. Here’s how they complement each other:

  • Centralised Tracking: GTM lets you manage Klaviyo’s tracking snippets from one place, ideal for headless or non-Shopify sites where native integrations fall short. If you're on Shopify, you can also explore the Shopify x Klaviyo: The Ultimate Integration Guide for a simpler setup path.

  • Custom Event Capture: Track unique actions, like quiz completions or video views, and send them as real-time events to Klaviyo.

  • Rich User Data: GTM can pass data like product name or price into Klaviyo events. Use this to trigger more personalised flows like browse abandonment or dynamic recommendations.

  • No-Code Setup: GTM’s interface allows marketers to build triggers (e.g. product page views) that fire Klaviyo scripts, all with minimal coding.

  • Consistent Tracking Across Platforms: GTM helps standardise data flow across Klaviyo, Google Analytics, Meta Ads, and more, keeping your event data aligned.

In short: GTM listens for on-site events and passes them to Klaviyo, which logs the data and uses it to trigger emails or SMS flows.

Events You Can Track with GTM

Here’s what you can capture with GTM:

  • Viewed Product: When someone checks out a product page.

  • Button Click: When they hit “Add to Cart” or a call-to-action.

  • Form Submission: When they sign up or complete a quiz.

  • Started Checkout: When they begin checkout (huge for non-Shopify sites).

  • Quiz Responses: When they finish a quiz on your site.

  • Custom Engagement Events: Like watching a video or adding to a wishlist.

Setting Up Google Tag Manager with Klaviyo

Ready to hook up Klaviyo with Google Tag Manager (GTM)? This section walks you through the setup, step by step, so your Klaviyo event tracking kicks into gear. It’s easier than you think—no coding required. Let’s get your site talking to Klaviyo in no time!

Step 1: Create a Google Tag Manager Account

First things first, head to Google Tag Manager and sign up. Follow the prompts to set up a new account and a workspace for your site. This is your tracking command centre.


GMT create new account.png  Alt text: Google Tag Manager homepage prompting users to create a new account.

Step 2: Install GTM on Your Site

Once your account’s set, GTM gives you two code snippets after setup:

  • Copy them from the container screen.

  • Paste one script in the <head> tag

  • Paste the other after the opening <body> tag

  • This links GTM to your website.

  • Important: These scripts must be hardcoded into your theme or site template—not injected via other tools.


 Install GTM on Your Site.png  Displays the Google Tag Manager installation snippet with instructions to place code in the <head> and <body> of a website.

Step 3: Install Klaviyo’s “Active on Site” Snippet (Outside of GTM)

Before using GTM for advanced tracking, ensure Klaviyo’s core tracking is active. This is done outside of GTM by placing the ‘Active on Site’ snippet directly into your website’s <head>.

Before diving in, make sure your Klaviyo base is solid by reviewing our Klaviyo Tutorial: 30-Minute Beginner's Guide, a great place to start if you’re new to Klaviyo flows and metrics.

The Active on Site snippet enables Klaviyo to detect who’s browsing your site, connect to user profiles, and log basic activity.

  • In Klaviyo, go to Integrations > Web Tracking > Setup Web Tracking


Add Klaviyo’s Active on-Site Snippet in GTM 1.png  Alt text: Klaviyo integrations page showing a “Set Up Web Tracking” button for adding website tracking scripts.
  • Copy the Active on Site snippet


Add Klaviyo’s Active on-Site Snippet in GTM 2.png  Alt text: Instructions from Klaviyo on how to add the JavaScript tracking snippet before the </body> tag on a website.
  • Paste it into your website’s <head> (before the closing </head> tag)


Add Klaviyo’s Active on-Site Snippet in GTM 3.png  Alt text: Google Tag Manager (GTM) interface displaying a Custom HTML tag with the Klaviyo tracking script inserted.

This ensures the script fires as soon as the page loads—without any delay.

Step 4: Add Klaviyo’s Viewed Product Tracking (Optional but Recommended)

To track product views and power flows like Browse Abandonment, use the “Viewed Product” snippet—but only fire it on product pages.

How to do it:

  • In Klaviyo, under Setup Web Tracking, copy the Viewed Product snippet

  • In GTM, create a New Tag:

    • Tag Type: Custom HTML


Add Klaviyo’s Active on-Site Snippet in GTM 4.png  Alt text: GTM workspace with the tag type selection panel open, showing the Custom HTML option selected.
  • Paste the Viewed Product snippet in the HTML field

  • Set the Trigger to fire only on product pages:

    • Trigger Type: Page View


Add Klaviyo’s Active on-Site Snippet in GTM 5.png  Alt text: GTM trigger selection screen with the “All Pages” Page View trigger highlighted.
  • Condition: Page URL contains /product (adjust if your URLs follow a different structure)

  • Save the tag and publish


Add Klaviyo’s Active on-Site Snippet in GTM 6.png  Alt text: Product page of KlaviyoTees displaying a URL path with /products/ for tracking “Viewed Product” events.

Best Practice: Ensure this tag fires after the Active on Site script has loaded, to preserve proper session attribution.

Step 5: Test Your Setup

Before building flows, confirm that your GTM tags and Klaviyo tracking are working as expected.

Use GTM’s Preview Mode:

  • In GTM, click Preview

  • Enter your website URL and browse several pages

  • Watch the GTM debug panel — you should see:

    • Active on Site tag fire on all pages

    • Viewed Product tag fire only on product pages

Verify in Klaviyo:

  • Use ?utm_email=you@example.com on your site URL—make sure the email belongs to an existing Klaviyo profile.

  • In Klaviyo, go to Dashboard → Activity Feed

  • Filter by Custom Events and look for:

    • Active on Site

    • Viewed Product

If these appear correctly, your setup is complete.


Test Your Setup 1.png  Demonstrates the Klaviyo Activity Feed, showing user engagement events like Viewed Product and Active on Website.
Source: Klaviyo 

Notes for Shopify Users

  • If you’re using Klaviyo’s Shopify App Embed, skip GTM—it handles basic tracking already. 

  • Want GTM’s extra control? Toggle off the App Embed in Klaviyo to avoid double data.

Real Use Cases – GTM Events That Power Klaviyo Automation

Integrating Google Tag Manager (GTM) with Klaviyo unlocks next-level event tracking and personalisation. Whether you're looking to capture deeper behavioural data, trigger smarter flows, or clean up your analytics, this setup helps bridge the gap between on-site actions and off-site messaging.


Real Use Cases 1.png  Shows a table of 8 unique GTM and Klaviyo integration use cases, with columns for use case, description, and integration benefits.

Pro tip: For a deep dive into setting up these events and tracking customer actions in Klaviyo, check out our guide on Klaviyo Flow Triggers 101.

Testing Your GTM + Klaviyo Setup

Testing keeps your Klaviyo event tracking on point. You don’t want to miss a “Button Click” or “Product View” because of a glitch. Here’s how to check it fast and fix issues.

How to Use GTM Preview Mode

GTM’s Preview mode shows what’s working:

  • Click “Preview,” enter your site URL, and browse. 


How to Use GTM Preview Mode 1.png  Alt text: GTM workspace showing an arrow pointing to the “Preview” button used to activate Tag Assistant.


How to Use GTM Preview Mode 2.png  Alt text: GTM preview mode setup screen prompting users to enter their site URL to connect for testing
Source: Analitify
  • Watch the pane, tags like “Viewed Product” should fire on product pages. 

  • Then, in Klaviyo’s Activity Feed, filter by “Custom Event” and look for “Form Submitted” or “Active on Site.” 

  • Add ?utm_email=your@email.com to the URL to link it to a profile, per Klaviyo’s Help Center.

Troubleshooting Tips

If you're unsure why an event isn’t firing or data isn't showing correctly, take a moment to review your broader analytics setup. Our guide on Mastering Klaviyo DTC Reporting & Analytics can help you understand what should be tracked and where gaps may appear.

  • Event not showing? Check the browser console for JavaScript errors, typos or blocks can stop tags.

  • Variable missing? Use GTM’s Data Layer tab in Preview to see what’s sent; fix it with a custom variable if empty.

  • Duplicates? Run GTM Tag Assistant to spot extra tags firing, like two “Active on Site” logs.

Quick tests save big headaches later.

Mapping GTM Events to Flows and Segments in Klaviyo

Your GTM events are gold, use them to trigger flows and segment customers in Klaviyo. Here’s how to make it happen.

Triggering Flows Using Custom Events

Flows send emails based on actions. 

  • In Klaviyo, pick “Create Flow,” choose “Metric,” and select your GTM event, like “Form Submitted”, to start a Welcome Flow.

  • For example, a signup triggers a “Thanks!” email, then a discount 24 hours later. 

  • Match GTM’s event name exactly, or it won’t work.

Segmenting with Event Properties

Segments group people by what they’ve done. To maximise the impact of segmentation, we recommend exploring our 3 Klaviyo Segmentation Strategies to Boost DTC Sales.

In Klaviyo’s “Lists & Segments,” use “What someone has done” and add properties (Klaviyo Developer Docs). Examples:

  • “Clicked Checkout but Didn’t Order”: “Started Checkout” event + “Has not ordered” condition, target abandoners.

  • “Quiz Result = Skincare”: “Submitted Quiz” event with “Result = Skincare”, send moisturizer promos.

Privacy, Consent and Performance Best Practices

Tracking’s great, but stay legal and fast. Here’s how to keep your GTM + Klaviyo setup clean.

GDPR/CCPA: Only Track with Consent

Laws like GDPR and CCPA require user consent. Use a Consent Management Platform to control GTM trigger activation. Only fire Klaviyo tags after the user provides opt-in, using a variable like consentCategory.analytics = true.

Show example:

GDPR CCPA Only Track with Consent.png  Alt text: Code snippet demonstrating how to trigger the Klaviyo “Viewed Product” event only if user consent is given.

Performance Consideration

A slow site loses customers.:

  • Use lightweight GTM triggers, page views or clicks, not heavy scripts. 

  • Test with Google PageSpeed Insights; trim unused tags if they lag. 

  • Also, keep in mind that email performance is just as crucial, learn how to avoid spam folders with our Email Deliverability: Step-by-Step Checklist to Stay Out of Spam.

  • Async loading (default in GTM) helps too.

FAQs

1. Can I track events across multiple domains with GTM and Klaviyo?

  • Yes, but you’ll need to configure cross-domain tracking in GTM and pass consistent user identifiers (like email or ID) to Klaviyo for accurate event linking.

2. How many custom events can I create in Klaviyo using GTM?

  • There’s no strict limit, but keeping your events organised (e.g., naming conventions) ensures smooth flow creation and segmentation.

3. Can GTM track user behaviour on a password-protected page?

  • Only if the tracking code is allowed to load. Ensure GTM and Klaviyo snippets are injected correctly and not blocked by auth layers.

4. Will using GTM slow down my website?

  • Not if used properly. GTM loads asynchronously and, when optimised, doesn’t impact performance noticeably. Just avoid firing too many heavy scripts.

5. What happens if a user has JavaScript disabled?

  • Event tracking won’t work, since GTM and Klaviyo both rely on JS. However, this affects only a small percentage of users.

Conclusion

If you're serious about understanding what your customers do and turning that insight into real growth, integrating Klaviyo with Google Tag Manager is a no-brainer. It helps you track key actions, like form submissions or product views, and use that data to automate smarter emails and texts.

Whether you run a DTC brand or a non-Shopify store, GTM gives you control without needing a dev. Plus, the right setup means you can finally ditch the guesswork and build flows that match actual customer behaviour. Clean data. Better targeting. More revenue.

Key Takeaways

  • Track Every Click: GTM captures product views, form fills, and button clicks for Klaviyo.

  • Trigger Flows That Convert: Use GTM events to start browse abandonment, welcome, or quiz-based flows.

  • Segment Smarter: Build Klaviyo segments with custom GTM event data like quiz results or checkout clicks.

  • Stay Compliant: Wrap all tags in consent conditions to meet GDPR and CCPA.

  • Keep It Fast: Use async tags and lightweight triggers to protect site speed.

Are you struggling to sync customer actions from your site into Klaviyo?

Let us help you build a clean, scalable event-tracking system using Google Tag Manager, constructed specifically for CRM performance. Click here and get your free GTM x Klaviyo audit today!




Imagine knowing exactly what your customers are doing on your website—every product they view, every button they click, every form they submit. Now imagine turning those actions into personalised emails that boost your sales. That’s the power of pairing Klaviyo with Google Tag Manager (GTM). 

This guide walks you through the setup, step by step, so you can start tracking like a pro. Whether you run a direct-to-consumer (DTC) brand, a non-Shopify store, or just want more control over your data, this playbook is for you.

How Klaviyo and Google Tag Manager Work Together

What is Google Tag Manager (GTM)?

GTM is a free tool from Google that manages tracking codes on your website. It tracks browser-side events—like what pages people visit or what buttons they click—and sends that info wherever you want, like Klaviyo. 

The best part? You don’t need a developer to set it up. It’s a game-changer for marketers who want to dig into data without waiting on tech support. For example, you can add tracking for a “Buy Now” button in minutes, all from GTM’s dashboard.

How Klaviyo and GTM Work Together

Using Google Tag Manager (GTM) with Klaviyo gives you powerful, flexible event tracking, without needing heavy dev work. Here’s how they complement each other:

  • Centralised Tracking: GTM lets you manage Klaviyo’s tracking snippets from one place, ideal for headless or non-Shopify sites where native integrations fall short. If you're on Shopify, you can also explore the Shopify x Klaviyo: The Ultimate Integration Guide for a simpler setup path.

  • Custom Event Capture: Track unique actions, like quiz completions or video views, and send them as real-time events to Klaviyo.

  • Rich User Data: GTM can pass data like product name or price into Klaviyo events. Use this to trigger more personalised flows like browse abandonment or dynamic recommendations.

  • No-Code Setup: GTM’s interface allows marketers to build triggers (e.g. product page views) that fire Klaviyo scripts, all with minimal coding.

  • Consistent Tracking Across Platforms: GTM helps standardise data flow across Klaviyo, Google Analytics, Meta Ads, and more, keeping your event data aligned.

In short: GTM listens for on-site events and passes them to Klaviyo, which logs the data and uses it to trigger emails or SMS flows.

Events You Can Track with GTM

Here’s what you can capture with GTM:

  • Viewed Product: When someone checks out a product page.

  • Button Click: When they hit “Add to Cart” or a call-to-action.

  • Form Submission: When they sign up or complete a quiz.

  • Started Checkout: When they begin checkout (huge for non-Shopify sites).

  • Quiz Responses: When they finish a quiz on your site.

  • Custom Engagement Events: Like watching a video or adding to a wishlist.

Setting Up Google Tag Manager with Klaviyo

Ready to hook up Klaviyo with Google Tag Manager (GTM)? This section walks you through the setup, step by step, so your Klaviyo event tracking kicks into gear. It’s easier than you think—no coding required. Let’s get your site talking to Klaviyo in no time!

Step 1: Create a Google Tag Manager Account

First things first, head to Google Tag Manager and sign up. Follow the prompts to set up a new account and a workspace for your site. This is your tracking command centre.


GMT create new account.png  Alt text: Google Tag Manager homepage prompting users to create a new account.

Step 2: Install GTM on Your Site

Once your account’s set, GTM gives you two code snippets after setup:

  • Copy them from the container screen.

  • Paste one script in the <head> tag

  • Paste the other after the opening <body> tag

  • This links GTM to your website.

  • Important: These scripts must be hardcoded into your theme or site template—not injected via other tools.


 Install GTM on Your Site.png  Displays the Google Tag Manager installation snippet with instructions to place code in the <head> and <body> of a website.

Step 3: Install Klaviyo’s “Active on Site” Snippet (Outside of GTM)

Before using GTM for advanced tracking, ensure Klaviyo’s core tracking is active. This is done outside of GTM by placing the ‘Active on Site’ snippet directly into your website’s <head>.

Before diving in, make sure your Klaviyo base is solid by reviewing our Klaviyo Tutorial: 30-Minute Beginner's Guide, a great place to start if you’re new to Klaviyo flows and metrics.

The Active on Site snippet enables Klaviyo to detect who’s browsing your site, connect to user profiles, and log basic activity.

  • In Klaviyo, go to Integrations > Web Tracking > Setup Web Tracking


Add Klaviyo’s Active on-Site Snippet in GTM 1.png  Alt text: Klaviyo integrations page showing a “Set Up Web Tracking” button for adding website tracking scripts.
  • Copy the Active on Site snippet


Add Klaviyo’s Active on-Site Snippet in GTM 2.png  Alt text: Instructions from Klaviyo on how to add the JavaScript tracking snippet before the </body> tag on a website.
  • Paste it into your website’s <head> (before the closing </head> tag)


Add Klaviyo’s Active on-Site Snippet in GTM 3.png  Alt text: Google Tag Manager (GTM) interface displaying a Custom HTML tag with the Klaviyo tracking script inserted.

This ensures the script fires as soon as the page loads—without any delay.

Step 4: Add Klaviyo’s Viewed Product Tracking (Optional but Recommended)

To track product views and power flows like Browse Abandonment, use the “Viewed Product” snippet—but only fire it on product pages.

How to do it:

  • In Klaviyo, under Setup Web Tracking, copy the Viewed Product snippet

  • In GTM, create a New Tag:

    • Tag Type: Custom HTML


Add Klaviyo’s Active on-Site Snippet in GTM 4.png  Alt text: GTM workspace with the tag type selection panel open, showing the Custom HTML option selected.
  • Paste the Viewed Product snippet in the HTML field

  • Set the Trigger to fire only on product pages:

    • Trigger Type: Page View


Add Klaviyo’s Active on-Site Snippet in GTM 5.png  Alt text: GTM trigger selection screen with the “All Pages” Page View trigger highlighted.
  • Condition: Page URL contains /product (adjust if your URLs follow a different structure)

  • Save the tag and publish


Add Klaviyo’s Active on-Site Snippet in GTM 6.png  Alt text: Product page of KlaviyoTees displaying a URL path with /products/ for tracking “Viewed Product” events.

Best Practice: Ensure this tag fires after the Active on Site script has loaded, to preserve proper session attribution.

Step 5: Test Your Setup

Before building flows, confirm that your GTM tags and Klaviyo tracking are working as expected.

Use GTM’s Preview Mode:

  • In GTM, click Preview

  • Enter your website URL and browse several pages

  • Watch the GTM debug panel — you should see:

    • Active on Site tag fire on all pages

    • Viewed Product tag fire only on product pages

Verify in Klaviyo:

  • Use ?utm_email=you@example.com on your site URL—make sure the email belongs to an existing Klaviyo profile.

  • In Klaviyo, go to Dashboard → Activity Feed

  • Filter by Custom Events and look for:

    • Active on Site

    • Viewed Product

If these appear correctly, your setup is complete.


Test Your Setup 1.png  Demonstrates the Klaviyo Activity Feed, showing user engagement events like Viewed Product and Active on Website.
Source: Klaviyo 

Notes for Shopify Users

  • If you’re using Klaviyo’s Shopify App Embed, skip GTM—it handles basic tracking already. 

  • Want GTM’s extra control? Toggle off the App Embed in Klaviyo to avoid double data.

Real Use Cases – GTM Events That Power Klaviyo Automation

Integrating Google Tag Manager (GTM) with Klaviyo unlocks next-level event tracking and personalisation. Whether you're looking to capture deeper behavioural data, trigger smarter flows, or clean up your analytics, this setup helps bridge the gap between on-site actions and off-site messaging.


Real Use Cases 1.png  Shows a table of 8 unique GTM and Klaviyo integration use cases, with columns for use case, description, and integration benefits.

Pro tip: For a deep dive into setting up these events and tracking customer actions in Klaviyo, check out our guide on Klaviyo Flow Triggers 101.

Testing Your GTM + Klaviyo Setup

Testing keeps your Klaviyo event tracking on point. You don’t want to miss a “Button Click” or “Product View” because of a glitch. Here’s how to check it fast and fix issues.

How to Use GTM Preview Mode

GTM’s Preview mode shows what’s working:

  • Click “Preview,” enter your site URL, and browse. 


How to Use GTM Preview Mode 1.png  Alt text: GTM workspace showing an arrow pointing to the “Preview” button used to activate Tag Assistant.


How to Use GTM Preview Mode 2.png  Alt text: GTM preview mode setup screen prompting users to enter their site URL to connect for testing
Source: Analitify
  • Watch the pane, tags like “Viewed Product” should fire on product pages. 

  • Then, in Klaviyo’s Activity Feed, filter by “Custom Event” and look for “Form Submitted” or “Active on Site.” 

  • Add ?utm_email=your@email.com to the URL to link it to a profile, per Klaviyo’s Help Center.

Troubleshooting Tips

If you're unsure why an event isn’t firing or data isn't showing correctly, take a moment to review your broader analytics setup. Our guide on Mastering Klaviyo DTC Reporting & Analytics can help you understand what should be tracked and where gaps may appear.

  • Event not showing? Check the browser console for JavaScript errors, typos or blocks can stop tags.

  • Variable missing? Use GTM’s Data Layer tab in Preview to see what’s sent; fix it with a custom variable if empty.

  • Duplicates? Run GTM Tag Assistant to spot extra tags firing, like two “Active on Site” logs.

Quick tests save big headaches later.

Mapping GTM Events to Flows and Segments in Klaviyo

Your GTM events are gold, use them to trigger flows and segment customers in Klaviyo. Here’s how to make it happen.

Triggering Flows Using Custom Events

Flows send emails based on actions. 

  • In Klaviyo, pick “Create Flow,” choose “Metric,” and select your GTM event, like “Form Submitted”, to start a Welcome Flow.

  • For example, a signup triggers a “Thanks!” email, then a discount 24 hours later. 

  • Match GTM’s event name exactly, or it won’t work.

Segmenting with Event Properties

Segments group people by what they’ve done. To maximise the impact of segmentation, we recommend exploring our 3 Klaviyo Segmentation Strategies to Boost DTC Sales.

In Klaviyo’s “Lists & Segments,” use “What someone has done” and add properties (Klaviyo Developer Docs). Examples:

  • “Clicked Checkout but Didn’t Order”: “Started Checkout” event + “Has not ordered” condition, target abandoners.

  • “Quiz Result = Skincare”: “Submitted Quiz” event with “Result = Skincare”, send moisturizer promos.

Privacy, Consent and Performance Best Practices

Tracking’s great, but stay legal and fast. Here’s how to keep your GTM + Klaviyo setup clean.

GDPR/CCPA: Only Track with Consent

Laws like GDPR and CCPA require user consent. Use a Consent Management Platform to control GTM trigger activation. Only fire Klaviyo tags after the user provides opt-in, using a variable like consentCategory.analytics = true.

Show example:

GDPR CCPA Only Track with Consent.png  Alt text: Code snippet demonstrating how to trigger the Klaviyo “Viewed Product” event only if user consent is given.

Performance Consideration

A slow site loses customers.:

  • Use lightweight GTM triggers, page views or clicks, not heavy scripts. 

  • Test with Google PageSpeed Insights; trim unused tags if they lag. 

  • Also, keep in mind that email performance is just as crucial, learn how to avoid spam folders with our Email Deliverability: Step-by-Step Checklist to Stay Out of Spam.

  • Async loading (default in GTM) helps too.

FAQs

1. Can I track events across multiple domains with GTM and Klaviyo?

  • Yes, but you’ll need to configure cross-domain tracking in GTM and pass consistent user identifiers (like email or ID) to Klaviyo for accurate event linking.

2. How many custom events can I create in Klaviyo using GTM?

  • There’s no strict limit, but keeping your events organised (e.g., naming conventions) ensures smooth flow creation and segmentation.

3. Can GTM track user behaviour on a password-protected page?

  • Only if the tracking code is allowed to load. Ensure GTM and Klaviyo snippets are injected correctly and not blocked by auth layers.

4. Will using GTM slow down my website?

  • Not if used properly. GTM loads asynchronously and, when optimised, doesn’t impact performance noticeably. Just avoid firing too many heavy scripts.

5. What happens if a user has JavaScript disabled?

  • Event tracking won’t work, since GTM and Klaviyo both rely on JS. However, this affects only a small percentage of users.

Conclusion

If you're serious about understanding what your customers do and turning that insight into real growth, integrating Klaviyo with Google Tag Manager is a no-brainer. It helps you track key actions, like form submissions or product views, and use that data to automate smarter emails and texts.

Whether you run a DTC brand or a non-Shopify store, GTM gives you control without needing a dev. Plus, the right setup means you can finally ditch the guesswork and build flows that match actual customer behaviour. Clean data. Better targeting. More revenue.

Key Takeaways

  • Track Every Click: GTM captures product views, form fills, and button clicks for Klaviyo.

  • Trigger Flows That Convert: Use GTM events to start browse abandonment, welcome, or quiz-based flows.

  • Segment Smarter: Build Klaviyo segments with custom GTM event data like quiz results or checkout clicks.

  • Stay Compliant: Wrap all tags in consent conditions to meet GDPR and CCPA.

  • Keep It Fast: Use async tags and lightweight triggers to protect site speed.

Are you struggling to sync customer actions from your site into Klaviyo?

Let us help you build a clean, scalable event-tracking system using Google Tag Manager, constructed specifically for CRM performance. Click here and get your free GTM x Klaviyo audit today!




Unlock deeper customer insights with Klaviyo and Google Tag Manager. Track every click, form, and product view—then turn that behaviour into automated flows that boost retention and revenue.

Imagine knowing exactly what your customers are doing on your website—every product they view, every button they click, every form they submit. Now imagine turning those actions into personalised emails that boost your sales. That’s the power of pairing Klaviyo with Google Tag Manager (GTM). 

This guide walks you through the setup, step by step, so you can start tracking like a pro. Whether you run a direct-to-consumer (DTC) brand, a non-Shopify store, or just want more control over your data, this playbook is for you.

How Klaviyo and Google Tag Manager Work Together

What is Google Tag Manager (GTM)?

GTM is a free tool from Google that manages tracking codes on your website. It tracks browser-side events—like what pages people visit or what buttons they click—and sends that info wherever you want, like Klaviyo. 

The best part? You don’t need a developer to set it up. It’s a game-changer for marketers who want to dig into data without waiting on tech support. For example, you can add tracking for a “Buy Now” button in minutes, all from GTM’s dashboard.

How Klaviyo and GTM Work Together

Using Google Tag Manager (GTM) with Klaviyo gives you powerful, flexible event tracking, without needing heavy dev work. Here’s how they complement each other:

  • Centralised Tracking: GTM lets you manage Klaviyo’s tracking snippets from one place, ideal for headless or non-Shopify sites where native integrations fall short. If you're on Shopify, you can also explore the Shopify x Klaviyo: The Ultimate Integration Guide for a simpler setup path.

  • Custom Event Capture: Track unique actions, like quiz completions or video views, and send them as real-time events to Klaviyo.

  • Rich User Data: GTM can pass data like product name or price into Klaviyo events. Use this to trigger more personalised flows like browse abandonment or dynamic recommendations.

  • No-Code Setup: GTM’s interface allows marketers to build triggers (e.g. product page views) that fire Klaviyo scripts, all with minimal coding.

  • Consistent Tracking Across Platforms: GTM helps standardise data flow across Klaviyo, Google Analytics, Meta Ads, and more, keeping your event data aligned.

In short: GTM listens for on-site events and passes them to Klaviyo, which logs the data and uses it to trigger emails or SMS flows.

Events You Can Track with GTM

Here’s what you can capture with GTM:

  • Viewed Product: When someone checks out a product page.

  • Button Click: When they hit “Add to Cart” or a call-to-action.

  • Form Submission: When they sign up or complete a quiz.

  • Started Checkout: When they begin checkout (huge for non-Shopify sites).

  • Quiz Responses: When they finish a quiz on your site.

  • Custom Engagement Events: Like watching a video or adding to a wishlist.

Setting Up Google Tag Manager with Klaviyo

Ready to hook up Klaviyo with Google Tag Manager (GTM)? This section walks you through the setup, step by step, so your Klaviyo event tracking kicks into gear. It’s easier than you think—no coding required. Let’s get your site talking to Klaviyo in no time!

Step 1: Create a Google Tag Manager Account

First things first, head to Google Tag Manager and sign up. Follow the prompts to set up a new account and a workspace for your site. This is your tracking command centre.


GMT create new account.png  Alt text: Google Tag Manager homepage prompting users to create a new account.

Step 2: Install GTM on Your Site

Once your account’s set, GTM gives you two code snippets after setup:

  • Copy them from the container screen.

  • Paste one script in the <head> tag

  • Paste the other after the opening <body> tag

  • This links GTM to your website.

  • Important: These scripts must be hardcoded into your theme or site template—not injected via other tools.


 Install GTM on Your Site.png  Displays the Google Tag Manager installation snippet with instructions to place code in the <head> and <body> of a website.

Step 3: Install Klaviyo’s “Active on Site” Snippet (Outside of GTM)

Before using GTM for advanced tracking, ensure Klaviyo’s core tracking is active. This is done outside of GTM by placing the ‘Active on Site’ snippet directly into your website’s <head>.

Before diving in, make sure your Klaviyo base is solid by reviewing our Klaviyo Tutorial: 30-Minute Beginner's Guide, a great place to start if you’re new to Klaviyo flows and metrics.

The Active on Site snippet enables Klaviyo to detect who’s browsing your site, connect to user profiles, and log basic activity.

  • In Klaviyo, go to Integrations > Web Tracking > Setup Web Tracking


Add Klaviyo’s Active on-Site Snippet in GTM 1.png  Alt text: Klaviyo integrations page showing a “Set Up Web Tracking” button for adding website tracking scripts.
  • Copy the Active on Site snippet


Add Klaviyo’s Active on-Site Snippet in GTM 2.png  Alt text: Instructions from Klaviyo on how to add the JavaScript tracking snippet before the </body> tag on a website.
  • Paste it into your website’s <head> (before the closing </head> tag)


Add Klaviyo’s Active on-Site Snippet in GTM 3.png  Alt text: Google Tag Manager (GTM) interface displaying a Custom HTML tag with the Klaviyo tracking script inserted.

This ensures the script fires as soon as the page loads—without any delay.

Step 4: Add Klaviyo’s Viewed Product Tracking (Optional but Recommended)

To track product views and power flows like Browse Abandonment, use the “Viewed Product” snippet—but only fire it on product pages.

How to do it:

  • In Klaviyo, under Setup Web Tracking, copy the Viewed Product snippet

  • In GTM, create a New Tag:

    • Tag Type: Custom HTML


Add Klaviyo’s Active on-Site Snippet in GTM 4.png  Alt text: GTM workspace with the tag type selection panel open, showing the Custom HTML option selected.
  • Paste the Viewed Product snippet in the HTML field

  • Set the Trigger to fire only on product pages:

    • Trigger Type: Page View


Add Klaviyo’s Active on-Site Snippet in GTM 5.png  Alt text: GTM trigger selection screen with the “All Pages” Page View trigger highlighted.
  • Condition: Page URL contains /product (adjust if your URLs follow a different structure)

  • Save the tag and publish


Add Klaviyo’s Active on-Site Snippet in GTM 6.png  Alt text: Product page of KlaviyoTees displaying a URL path with /products/ for tracking “Viewed Product” events.

Best Practice: Ensure this tag fires after the Active on Site script has loaded, to preserve proper session attribution.

Step 5: Test Your Setup

Before building flows, confirm that your GTM tags and Klaviyo tracking are working as expected.

Use GTM’s Preview Mode:

  • In GTM, click Preview

  • Enter your website URL and browse several pages

  • Watch the GTM debug panel — you should see:

    • Active on Site tag fire on all pages

    • Viewed Product tag fire only on product pages

Verify in Klaviyo:

  • Use ?utm_email=you@example.com on your site URL—make sure the email belongs to an existing Klaviyo profile.

  • In Klaviyo, go to Dashboard → Activity Feed

  • Filter by Custom Events and look for:

    • Active on Site

    • Viewed Product

If these appear correctly, your setup is complete.


Test Your Setup 1.png  Demonstrates the Klaviyo Activity Feed, showing user engagement events like Viewed Product and Active on Website.
Source: Klaviyo 

Notes for Shopify Users

  • If you’re using Klaviyo’s Shopify App Embed, skip GTM—it handles basic tracking already. 

  • Want GTM’s extra control? Toggle off the App Embed in Klaviyo to avoid double data.

Real Use Cases – GTM Events That Power Klaviyo Automation

Integrating Google Tag Manager (GTM) with Klaviyo unlocks next-level event tracking and personalisation. Whether you're looking to capture deeper behavioural data, trigger smarter flows, or clean up your analytics, this setup helps bridge the gap between on-site actions and off-site messaging.


Real Use Cases 1.png  Shows a table of 8 unique GTM and Klaviyo integration use cases, with columns for use case, description, and integration benefits.

Pro tip: For a deep dive into setting up these events and tracking customer actions in Klaviyo, check out our guide on Klaviyo Flow Triggers 101.

Testing Your GTM + Klaviyo Setup

Testing keeps your Klaviyo event tracking on point. You don’t want to miss a “Button Click” or “Product View” because of a glitch. Here’s how to check it fast and fix issues.

How to Use GTM Preview Mode

GTM’s Preview mode shows what’s working:

  • Click “Preview,” enter your site URL, and browse. 


How to Use GTM Preview Mode 1.png  Alt text: GTM workspace showing an arrow pointing to the “Preview” button used to activate Tag Assistant.


How to Use GTM Preview Mode 2.png  Alt text: GTM preview mode setup screen prompting users to enter their site URL to connect for testing
Source: Analitify
  • Watch the pane, tags like “Viewed Product” should fire on product pages. 

  • Then, in Klaviyo’s Activity Feed, filter by “Custom Event” and look for “Form Submitted” or “Active on Site.” 

  • Add ?utm_email=your@email.com to the URL to link it to a profile, per Klaviyo’s Help Center.

Troubleshooting Tips

If you're unsure why an event isn’t firing or data isn't showing correctly, take a moment to review your broader analytics setup. Our guide on Mastering Klaviyo DTC Reporting & Analytics can help you understand what should be tracked and where gaps may appear.

  • Event not showing? Check the browser console for JavaScript errors, typos or blocks can stop tags.

  • Variable missing? Use GTM’s Data Layer tab in Preview to see what’s sent; fix it with a custom variable if empty.

  • Duplicates? Run GTM Tag Assistant to spot extra tags firing, like two “Active on Site” logs.

Quick tests save big headaches later.

Mapping GTM Events to Flows and Segments in Klaviyo

Your GTM events are gold, use them to trigger flows and segment customers in Klaviyo. Here’s how to make it happen.

Triggering Flows Using Custom Events

Flows send emails based on actions. 

  • In Klaviyo, pick “Create Flow,” choose “Metric,” and select your GTM event, like “Form Submitted”, to start a Welcome Flow.

  • For example, a signup triggers a “Thanks!” email, then a discount 24 hours later. 

  • Match GTM’s event name exactly, or it won’t work.

Segmenting with Event Properties

Segments group people by what they’ve done. To maximise the impact of segmentation, we recommend exploring our 3 Klaviyo Segmentation Strategies to Boost DTC Sales.

In Klaviyo’s “Lists & Segments,” use “What someone has done” and add properties (Klaviyo Developer Docs). Examples:

  • “Clicked Checkout but Didn’t Order”: “Started Checkout” event + “Has not ordered” condition, target abandoners.

  • “Quiz Result = Skincare”: “Submitted Quiz” event with “Result = Skincare”, send moisturizer promos.

Privacy, Consent and Performance Best Practices

Tracking’s great, but stay legal and fast. Here’s how to keep your GTM + Klaviyo setup clean.

GDPR/CCPA: Only Track with Consent

Laws like GDPR and CCPA require user consent. Use a Consent Management Platform to control GTM trigger activation. Only fire Klaviyo tags after the user provides opt-in, using a variable like consentCategory.analytics = true.

Show example:

GDPR CCPA Only Track with Consent.png  Alt text: Code snippet demonstrating how to trigger the Klaviyo “Viewed Product” event only if user consent is given.

Performance Consideration

A slow site loses customers.:

  • Use lightweight GTM triggers, page views or clicks, not heavy scripts. 

  • Test with Google PageSpeed Insights; trim unused tags if they lag. 

  • Also, keep in mind that email performance is just as crucial, learn how to avoid spam folders with our Email Deliverability: Step-by-Step Checklist to Stay Out of Spam.

  • Async loading (default in GTM) helps too.

FAQs

1. Can I track events across multiple domains with GTM and Klaviyo?

  • Yes, but you’ll need to configure cross-domain tracking in GTM and pass consistent user identifiers (like email or ID) to Klaviyo for accurate event linking.

2. How many custom events can I create in Klaviyo using GTM?

  • There’s no strict limit, but keeping your events organised (e.g., naming conventions) ensures smooth flow creation and segmentation.

3. Can GTM track user behaviour on a password-protected page?

  • Only if the tracking code is allowed to load. Ensure GTM and Klaviyo snippets are injected correctly and not blocked by auth layers.

4. Will using GTM slow down my website?

  • Not if used properly. GTM loads asynchronously and, when optimised, doesn’t impact performance noticeably. Just avoid firing too many heavy scripts.

5. What happens if a user has JavaScript disabled?

  • Event tracking won’t work, since GTM and Klaviyo both rely on JS. However, this affects only a small percentage of users.

Conclusion

If you're serious about understanding what your customers do and turning that insight into real growth, integrating Klaviyo with Google Tag Manager is a no-brainer. It helps you track key actions, like form submissions or product views, and use that data to automate smarter emails and texts.

Whether you run a DTC brand or a non-Shopify store, GTM gives you control without needing a dev. Plus, the right setup means you can finally ditch the guesswork and build flows that match actual customer behaviour. Clean data. Better targeting. More revenue.

Key Takeaways

  • Track Every Click: GTM captures product views, form fills, and button clicks for Klaviyo.

  • Trigger Flows That Convert: Use GTM events to start browse abandonment, welcome, or quiz-based flows.

  • Segment Smarter: Build Klaviyo segments with custom GTM event data like quiz results or checkout clicks.

  • Stay Compliant: Wrap all tags in consent conditions to meet GDPR and CCPA.

  • Keep It Fast: Use async tags and lightweight triggers to protect site speed.

Are you struggling to sync customer actions from your site into Klaviyo?

Let us help you build a clean, scalable event-tracking system using Google Tag Manager, constructed specifically for CRM performance. Click here and get your free GTM x Klaviyo audit today!




Join our newsletter list

Sign up to get the most recent blog articles in your email every week.

Share this post to the social medias