Integrate Klaviyo with your website using Google Tag Manager Server container

Apr 11, 2024
Apr 17, 2021
Also available in

Klaviyo Tag for the Google Tag Manager server container is a custom tag that will help you to add new users, send events and parameters from your site to Klaviyo. With this tag, you don’t need to ask your developers to set up the integration. Using this custom tag for the Google Tag Manager server container, you can integrate Klaviyo using the server container events and parameters. 

The power of Klaviyo cannot be underestimated when it comes to how much revenue it can make for your business, which is why we want you to know about this latest development from us.  

With the help of our custom tag, there’s no need for any development work to set up the integration between your site and Klaviyo. The setup is done inside the Google Tag Manager server container interface and processed by Klaviyo tag for the Google Tag Manager server container.

That is a great way to save time and money on your marketing efforts. So make sure you take advantage of it! Klaviyo JavaScript can slow down your page speed. Many users find that the new Klaviyo onsite js is large and takes a long time to load, negatively impacting their PageSpeed scores, especially on mobile devices. Setting up a server-side Klaviyo integration will help you avoid these issues while still taking advantage of all of its features.

Klaviyo will facilitate every aspect from customer acquisition to conversion optimization, which means more revenue for your business. 

So what are you waiting for? Make the most of this latest development by setting up site integration today – everything is done inside the GTM server container UI. No developers required. 

How to integrate Klaviyo with your site using the Google Tag Manager server containerCopy link to this section

If you have email campaigns, it’s essential to integrate your site and Klaviyo. The more information about user actions you send to Klaviyo, the more possibilities you have for segmenting lists, automating campaigns, and sending highly targeted and personalized emails. 

Klaviyo has some pre-built integration for sites that use standard CMS like Shopify. But what if you have a custom site or want to track additional events like add to wishlist, form submits, or site search? Or maybe you want to send other events from your Shopify, BigCommerce, or WordPress store? 

Klaviyo is the best way to improve your email marketing and drive up conversion rates. But bear in mind that there will be a lot of work cut out for you if you want to implement it on your site.

Server-side Klaviyo integration has two main benefits over JavaScript:

  • Server-side tags won’t overload your website. As a result, your website will have higher PageSpeed scores, which may positively affect your organic positions. Some users complain that the new version of Klaviyo JavaScript takes 9 seconds to load. 
  • SS Klaiyo tag can add new users to Klaviyo. Previously it required backend integration.

Using our Klaviyo Tag for the Google Tag Manager, you can: 

  • add new users to Klaviyo
  • track user activity on-site
  • send events and parameters

Unfortunately, this tag does not support Klaviyo Forms.

1. First of all, you need to create and set up a Google Tag Manager server container. Follow this guide on setting up the GTM server container.

2. Once you’ve set up the server container, you need to define what user data you want to send and when you want to send it. After that, make sure that the Google Tag Manager Web container has this information. Chances are you will have this information inside the GTM variables or data layer if you used the Google Tag Manager Web container to set up Google Analytics or Facebook tracking.

3. In this step, you need to pass information from the Web Google Tag Manager container to the Server container. I recommend using our Data Tag and Data Client for that. The tag and client were designed to send information from the web container to the server, including variables, data layer, events, etc. Data Tag sends information from the web container, and Data Client retrieves this data inside the server container events data. You can check out our article on how to send data from the web Google Tag Manager to the server if you need a detailed description.

4. Import Klaviyo tag to the Google Tag Manager Server container. Download it from GitHub and import it using the template gallery. Click Templates -> Under Tag Templates click New -> Click on the three dots on the top right corner -> Import -> When done, click Save. 

5. Go to the tags section inside the server container -> Click New -> Select Klaviyo tag that you’ve recently imported -> Add tag name -> Add your Klaviyo Public API key (how to find  public API key)

6. In this example, I will show you how to send purchase events to Klaviyo, assign this event to the existing user or create a new user. 

Inside the server GTM container, create a new Klaviyo tag. Add Klaviyo Public API Key, select event and add variable that includes user email. 

Klaviyo tag will use email to assign events to Klaviyo profile. If there is no user with this email, it will create a new user. This tag should trigger on the purchase event. 

klaviyo tag for server gtm

7. Let me also show you how to get user email using Data Tag for the Google Tag Manager Web container. Create a new tag inside the Web container and select tag type Data to GTM Server-Side (you can download it from GitHub and import to your web container) -> Select a standard event name Purchase -> Add GTM server-side domain and GTM Server Preview HTTP header (preview header is required if you want to see Data Tag information inside the Google Tag Manager server preview mode) -> To send user email on the purchase event, click on the user data, select an email address and add a variable that has user email. This tag should trigger the purchase event. You should also add Data Client to the server container. It will listen to Data Tag and add information to the event data inside the server container. To add Data Client, import it inside the Clients Templates. 

data tag  - stape

8. Open Preview and Debug mode of the Server and Web containers (make sure you’ve added a GTM Server preview HTTP header, it is required to see Data Tag events inside the Server container preview more. You can find it by clicking the three dots in the top right corner of the Google Tag Manager Server container preview mode and choose “Send requests manually.” )

9. Once you’ve verified that the Klaviyo tag  triggers inside the Google Tag Manager Server container and sends all the parameters, go to your Klaviyo account and check if that event was added to the user. Don’t forget to publish your changes.

ConclusionCopy link to this section

Having Klaviyo integrated with your site will help you utilize email marketing campaigns more efficiently. Klaviyo Tag for the Google Tag Manager server container allows you to set up the integration with no custom code required or long waiting time.

If you have any questions about the Klaviyo tag or other tags, contact us  at

We can help you with Klaviyo!

All it takes is a few simple questions. Click Get A Quote, fill up the form, and we will send you a quote.

Get A Quote
Tagged with:EmailsGTM tag

Host your GTM server at Stape