Server-side tracking in Google Tag Manager (GTM) means your tags run through a cloud server instead of the user’s browser.
This setup reduces data loss and helps you comply with privacy laws.
It also improves website speed as your site isn’t slowed down by third-party scripts running in the browser, and gives you more control over what data is sent to platforms like Google Analytics, Meta, or TikTok.
In this article, we’ll explain how server-side GTM works, how it compares to client-side tracking, and how to set it up.
Server-side tracking is the data collection method that captures info about user interactions on a dedicated server instead of browsers (like client-side tracking does). With server-side tracking, you can capture event data that won't be affected by ad blockers and browser restrictions, providing better data accuracy.
Besides high data quality, server-side tagging also offers privacy and control over the data you track, since after capturing, you can modify it and only then send to analytics tools such as Google Analytics 4 or Google Ads.
Check the detailed explanation of server-side tracking and how you can benefit from setting it up in our article on what is server-side tracking. |
Server-side tracking in GTM means user interactions are sent to a cloud server before reaching analytics or ad platforms. This setup helps you keep more data, avoid browser restrictions, and manage what’s shared with each platform.
Instead of firing tags directly in the browser, you use a server container hosted on your own subdomain (like anything.yoursite.com) to collect and forward events.
This setup acts as a middle layer between your site and analytics or ad platforms. Your website or app sends key interactions, such as pageviews or purchases, to the server container. From there, the data can be cleaned, enriched, and routed to different platforms depending on your configuration.
You stay in control of what gets shared and when. While the browser still collects the original data, the server-side container lets you process it more securely and flexibly before sending it out.
Web GTM, also called client-side tracking, runs directly in the user’s browser. When someone visits your site, the browser loads all tracking scripts like Google Analytics, Meta Pixel, or TikTok tags. Each script then sends data straight to its platform. This setup is quick to implement but comes with limits.
Browsers now block or restrict many tracking requests, especially on iOS or privacy-first browsers. If a script doesn’t load, or if JavaScript is disabled, the data never gets sent.
Server-side GTM handles things differently. Instead of running tags in the browser, it sends the same events to a cloud server where you host your GTM server container. From there, you can clean, filter, or enrich the data and forward it to each platform. This helps reduce data loss, avoid browser-related issues, and limit exposure to third-party scripts.
You stay in control of what gets shared. You can add user IDs, campaign data, or other values before the data leaves your server. It also improves attribution accuracy since more events are captured and processed in one place.
Server-side tracking doesn’t replace browser tracking entirely. Most of the data is still collected in the browser, it’s just passed through the server for better handling and delivery.
Feature | Client-side (Web GTM) | Server-side (GTM server container) |
---|---|---|
Where tags run | In the browser | On your cloud server |
Ad blocker resistance | Low | High (with custom subdomain) |
Data control | Limited | Full control over what’s shared |
Cookie lifespan on Safari | 1- 7 days | Up to 13 months (if set from your server using same-domain setup) |
Setup complexity | Low | Medium (simplified with tools like Stape) |
GTM server-side tracking works by adding a cloud server between your website and the platforms you send data to. When someone visits your site, their actions, like a pageview, form submission, or purchase, are still captured in the browser. But instead of sending this data directly to platforms like Google Analytics or Meta, it first goes to your server container hosted at anything.yoursite.com for example.
The server container runs on a cloud server, which you can set up manually or use a ready-to-launch service like Stape to simplify the process. It uses GTM’s rules like tags, triggers, and variables to handle the data and send it to the right platforms. This step lets you filter, modify, or enrich the data before it leaves your server.
You can remove unnecessary fields, add campaign info, or standardize formats across tools. It also helps reduce data loss from browser restrictions or blocked scripts.
To use server-side tracking, you need a cloud server to host the GTM container, a custom subdomain, a client to receive requests, and tags to forward the data. This setup gives you more control over how event data is handled and shared.
The server GTM container is a key element of the Google Tag Manager server tag environment. Instead of performing tag processing directly in the user's browser, as a traditional client GTM does, this container runs on the server. This greatly improves performance as the load on the user's device is reduced, allowing web pages to load faster. In traditional methods of tag processing, the user's browser spends resources on executing JavaScript code, which can slow down the site, mainly when a large number of third-party scripts or analytical tools are used. Server-side tagging eliminates these problems because most processes run outside the browser.
A popular use case for a server GTM container is working with analytics tags. Instead of loading Google Analytics tags directly on the client's browser, the website sends data to the server GTM container.
Hosting server-side GTM manually on Google Cloud or AWS requires technical setup, custom configurations, scaling rules, SSL and DNS setup, and ongoing monitoring. It’s time-consuming and usually needs a developer.
Stape solves this by offering container hosting designed for server-side GTM. It includes:
Thanks to this setup, you can go live without touching code or managing the server yourself.
On top of that, Stape includes tools that improve how tracking works and what data you can collect:
There are also many other advantages to using Stape hosting for server GTM, like faster load times or cleaner DNS setups that help avoid browser-level issues.
Below are the top five benefits of SGTM:
These are only the top advantages of the GTM server container. We have a blog post on our blog covering all the benefits of server-side tracking in detail.
Setting up server-side tracking in GTM requires two GTM containers: a web container to collect data from the browser and a server container to process that data and send it to platforms like Google Analytics or Meta.
If you use Stape, you don’t need to manage the server manually through Google Cloud or AWS. Stape handles provisioning, domain setup, scaling, and SSL so you can launch a working server container without a lot of coding.
You can host the container on your own subdomain (like anything.yoursite.com), which helps avoid being blocked by ad blockers and keeps tracking requests first-party.
Stape also includes a Preview mode to test events and make sure everything is working correctly before publishing.
Here’s how to get started with Stape:
1. Create a Stape account.
2. Set up a Server GTM container and host it using your or Stape’s subdomain.
3. Configure data transfer from your web container to the server container with the help of Stape to improve conversion tracking accuracy and reduce data loss caused by ad blockers or browser privacy settings.
Then, you have different options:
4. Connect integrations depending on your goals.
5. Add analytics tags like Google Analytics 4 or Matomo.
6. Add advertising tags like Meta (Conversions API), TikTok, Snapchat, Microsoft Ads, or Google Ads server-side conversion tracking.
Google Cloud Platform offers a free test environment that effectively manages server-side tagging. However, to integrate it into production, you must pay a minimum of $120/month + additional fees that depend on the website traffic.
Stape has a range of pricing plans to choose from: free, pro, business, enterprise and custom. Our free plan lets you get up to 10,000 requests per month.
There is also a pricing calculator on our website that lets you figure out which plan is right for your site.
Is server-side tracking worth trying? We believe the answer is absolutely YES if you want to collect data about your website visitors using advanced technology in a privacy-compliant way.
When it comes to GTM server-side vs. client-side, the server-side option has numerous advantages at the onset of the cookieless era. With server-side tracking, you get more accurate data collection and conversion tracking, complete data control, and faster website load. You can gather more data efficiently and get insights client-side tracking could never provide. Most importantly, server-side GTM helps you stay compliant and treat customer data responsively. Arguably, compliance is a very important aspect of a business's reputation in customers' eyes.
If you have any questions about sending data to the server side in GTM, our team of experts can help!
All it takes is a few simple questions. Click Get A Quote, fill up the form, and we will send you a quote.
Comments