Client-side tracking isn't delivering as good a result as it used to. Ad blockers and browser privacy updates block data from being collected and sent to ad and analytics platforms.
Server-side tagging solves this by introducing a middleware cloud server, helping you collect more complete data, set more resilient cookies, and comply with legal requirements.
This guide explains how server-side tagging works, how to set it up, and which tools to use to do it right.
Let's dive in.
Server-side tagging means the data is still collected in the browser, but it doesn't go straight to platforms like Meta or Google.
Instead, it first passes through a cloud server where your Google Tag Manager (GTM) server container processes this data and sends it to the platforms or tools you use, such as Meta, Google Analytics, or others.
To make this setup work, you need somewhere to host that cloud server.
That's where Stape helps: it gives you a ready-to-use environment for your GTM server container without the need to set up your own infrastructure.
Server-side tagging improves data accuracy and privacy by reducing reliance on the user’s browser and avoiding some data loss due to browser limitations.
More marketers are moving away from browser-based tracking in favor of server-side setups. Those are the main reasons why they do so:
First-party cookies set via your server can also last much longer, which helps track where your conversions really come from. For example, analytics cookies via server-side can live for up to 400 days instead of being deleted after a week.
And since tracking requests come from your domain, ad blockers are less likely to filter them out, resulting in more complete conversion data.
You might often see "server-side tagging" and "server-side tracking" used interchangeably, but technically, they describe two different approaches.
Server-side tagging still starts in the browser.
The data is collected there, but instead of being sent directly to analytics or ad platforms, it first passes through a cloud server.
That's where the tags run, data gets filtered or enriched, and then forwarded to platforms like Google Analytics 4 (GA4) or Meta.
Server-side tracking, on the other hand, skips the browser completely.
All the data comes directly from backend systems or other servers and is then sent to the analytics or ad platforms with no interaction from the user’s device at all.
In practice, many marketers and platforms don't draw a clear line between the two, so the terms are often mixed.
You can use either one, but if you want to be precise, tagging is browser-based with server processing, and tracking is fully server-to-server.
In a traditional client-side setup, your website’s GTM web container runs in the browser and sends data straight to third-party services (e.g., Google Analytics, Facebook, etc.).
In server-side tagging, you introduce a GTM server container on a cloud server that sits between your website and those third-party platforms. Here’s the basic flow:
In server-side tagging, the user’s browser sends tracking events to your GTM server container, which then forwards them to third-party tools like GA4 or Facebook. This creates a first-party data stream controlled by you.
When a user triggers an event (say, a page view or a purchase), the browser sends that data to your server container’s endpoint (often a subdomain like ss.yourdomain.com).
A Client component parses the incoming request inside the server container and makes the data available to your configured server tags.
Those server-side tags then forward the data to the target platforms (e.g., Google Analytics, Google Ads, Facebook) via their APIs.
Setting up server-side tagging may sound complex, but Stape has adapted this process for marketers and business owners.
Simply follow these steps to set up your server-side tagging:
Use GTM's preview/debug mode for both your web and server containers. Trigger some test events (like a pageview or test conversion) and verify in the server container's debug panel that the events are received and forwarded correctly.
Once everything looks good, publish the changes in both containers.
Your site is now live with server-side tagging.
In our blog post, there's a more detailed description and steps to perform GTM testing.
Running server-side tagging on your own sounds good until you look at the monthly cost, setup time and effort, and maintenance. That’s why marketers and business owners choose a managed solution like Stape.
Stape provides you with:
No need to configure Google Cloud Run, self-host, or manage scaling.
Stape provides a ready-to-use cloud server for your GTM server container, so you can skip the backend setup and start tracking immediately.
Everything you need to manage your setup is in one place. You can see your container status, connect a domain, activate power-ups, and check logs.
Hosting your own server can easily go over $100/month. With Stape, you can start for free and then continue at $20/month or scale with a bigger plan.
You can use advanced features without custom dev work:
Stape is also one of the largest contributors to the GTM Template Gallery.
You'll find ready-to-use templates for GA4, Facebook, TikTok, Matomo, Piwik PRO, and more, all designed to simplify server-side setups and reduce manual work.
Your web container is now downloaded through a global CDN, a group of servers worldwide that helps pages load faster by using the server closest to your visitor.
You can (and should) also connect a custom subdomain, like anything.yoursite.com, to send data through your own domain and improve tracking accuracy.
There’s a clear knowledgebase and documentation in the Helpdesk and a support team ready to help or advise at any moment.
Client-side tagging means your tracking tags run in the user’s browser.
When someone visits your site or takes an action, the browser sends that data directly to platforms like GA4 or Meta.
This type of tagging has a lot of limits. Ad blockers, browser privacy restrictions can block your requests or cause you to miss out on important information, which leads to data loss.
Server-side tagging, like the one provided by Stape, works differently.
Instead of sending data straight from the browser, it first goes to your cloud server, usually through a custom subdomain like anything.yoursite.com.
From there, the server forwards the data to ad and analytics platforms.
This setup gives you more control over what data gets shared and helps you stay compliant with privacy laws. It also improves data accuracy by avoiding browser-related issues, so ad platforms get the right signals to adjust your campaigns and reach people who are more likely to convert.
Server-side tagging helps protect users' privacy by giving you more control over how and where user data is used.
Instead of sending data straight from the browser to third-party platforms for ads and analytics, it first goes to your cloud server.
There, you can remove or anonymize personal details like IP addresses or emails before forwarding them. You can also choose a server location that keeps data within the EU, which supports GDPR's localization requirements.
An important thing to add is the user's consent. You know, this basic window "We use cookies", where the user chooses to agree or to refuse.
This way, if the user opts out, their data won't be used, and you will be compliant with GDPR rules.
Cookies are an important tool for gathering user data, and server-side tagging helps you make the most of them by improving how they're stored, refreshed, and recognized.
Here's what it changes and why it matters for your tracking:
Browsers are less likely to block or delete them.
Analytics or advertising cookies set via your server can last for months (up to 13 months) rather than being deleted in a few days, as is the case with browser tagging.
This provides much better continuity for tracking returning visitors.
To bypass this, Stape's Cookie Keeper power-up continuously refreshes your important cookies so Safari doesn't expire them after a week.
This helps browsers like Safari treat cookies as truly first-party, which improves their lifespan and accuracy.
This makes a first-party, server-side setup even more important for keeping your tracking and attribution accurate over time.
Server-side tagging gives even more results when you pair it with the right extras.
These Stape tools help you set things up, keep your user data clean, and deal with ad blockers or disappearing cookies so everything just works like it should:
If you’re tracking for a specific ad platform, a dedicated gateway makes setup faster and easier.
Stape offers preconfigured gateways that automatically send events from your cloud server to the platform you choose without any manual tagging.
Each gateway is tailored to its platform’s API, so you get accurate event tracking with less configuration.
Monitoring shows if key events (like purchases or sign-ups) suddenly stop working.
For example, if no "Add to Cart" events are recorded for hours, even though people are using your site.
You'll get notified right away, so you can fix the issue quickly by checking your GTM tags and triggers, using preview mode to test events, or reviewing recent site changes that may have influenced the setup.
Once server-side tagging is running, you will probably want to see what difference it actually makes.
Stape Analytics measures how much data was recovered from ad blockers and browsers with tracking preventions.
For example, in a 10-day test with over 7 million requests, 3.29% of events were recovered from ad blockers and 20.71% from tracking prevention mechanisms like Safari ITP.
You'll get your data breakdowns directly inside your Stape account, no extra dashboards or integrations are required.
Sometimes, things don't work as expected. Usually, it is because of a small setup detail. Here's what to check first and how to get things back on track:
A 403 indicates permission issues (often using the wrong container ID or a missing authorization token).
How to solve: make sure you have published your server container and that your web container is pointed to the correct server URL/ID.
How to solve: use a custom domain to make requests appear first-party.
Then double-check your web tags, they need to point to your server container URL and include all required parameters (like event name, value, currency, or event ID) so the server receives the whole event.
Use GTM's preview mode to test if the tag fires correctly.
How to solve: make sure your custom domain is correctly configured to allow cross-origin requests.
You may need to update server headers or CSP rules to allow traffic between your web container and your server container.
How to solve: add event deduplication using the same event ID in both browser and server tags (especially for platforms like Meta).
If conversions are still missing, use GTM's debug mode to check if the server tag fired and the event was received.
It's a good solution for anyone who needs accurate tracking: eCommerce brands, agencies, SaaS teams, and publishers.
If you run paid ads and want better attribution or more control over what data is shared, it's worth it. Especially now that browsers remove cookies and ad platforms expect cleaner, more reliable data.
Not really. Stape makes it easy: you don’t need to code or manage your own server, Stape provides hosting and prebuilt templates.
No, but it's quickly becoming the smarter option. Client-side tracking is missing more data because of browser privacy updates, cookie restrictions, and ad blockers.
Server-side gives you cleaner insights and helps you stay compliant with privacy regulations.
With server-side tagging, your site sends data to your cloud server first, then to GA4. This avoids browser issues and gives you better control over what's tracked.
GTM runs in the browser. sGTM runs on a server. They work together: the browser sends data to the server, and the server forwards it to your tools like GA4 or Meta.
Comments