What Is GTM Server-Side Tagging? Setup, Components, and Use Cases
Google Tag Manager (GTM) server-side tagging moves part of the tagging process from the user's browser to a server environment.

Google Tag Manager (GTM) server-side tagging moves part of the tagging process from the user's browser to a server environment.
Unlike a traditional web container, a server container can receive event requests, process them, and send the required data to analytics and advertising platforms. The web container still has an important role in collecting user interactions and sending requests to the server.
A typical setup includes a web container, server container, clients, tags, triggers, variables, and a tagging server. These components work together to control how data moves from a website or app to its final destinations.Support Google
What Is GTM Server-Side Tagging?
GTM server-side tagging is a Google Tag Manager setup that uses a server container to process measurement requests before they are sent to external platforms.
The web container remains responsible for collecting interactions, while the server container provides a separate environment for processing and forwarding data.Support Google
This architecture can provide more control over data processing, vendor requests, and the information sent to each destination.
Does GTM Server-Side Tagging Replace the Web Container?
No. Server-side tagging does not replace the web container.
A typical implementation uses both containers:
Web Container | Server Container |
|---|---|
Runs on the website or app | Runs in a cloud environment |
Collects user interactions | Receives measurement requests |
Generates events | Processes incoming data |
Runs browser-side tags | Sends data to destination platforms |
Sends requests to the server | Applies server-side rules |
The web container and server container have different responsibilities.
For example, a user can complete a purchase on a website. The web container collects the purchase event and sends a request to the server container. The server container then processes the request and sends the required information to GA4, Google Ads, Meta, or another destination.
This means server-side tagging should usually be viewed as an additional processing layer, rather than a replacement for web GTM.
Web Container vs. Server Container
The main difference is where the container runs and what it is responsible for.
Web Container | Server Container | |
|---|---|---|
Environment | User's browser or app | Server environment |
Main role | Collect interactions and generate requests | Process and route requests |
Tags | Browser-side tags | Server-side tags |
Triggers | Determine when web tags fire | Determine when server tags fire |
Variables | Provide browser-side data | Provide server-side data |
Vendor requests | Can be sent directly from the browser | Can be sent from the server |
Processing | Primarily client-side | Primarily server-side |
Infrastructure | Website or app | Tagging server and cloud infrastructure |
A server container can reduce the amount of vendor-specific processing that happens in the browser. It can also provide a central place to validate and modify incoming data before it reaches external platforms.Support Google
What Are the Core Components of a Server Container?
A server container has several components that work together to receive, process, and forward data.
Clients
Clients are responsible for receiving incoming requests and converting them into events that the server container can process.
When a request reaches the server container, a client determines whether it can handle that request.
For example, a GA4 request can be handled by the GA4 client.
The client therefore acts as the first processing layer inside the server container.
Tags, Triggers, and Variables
Once a client processes a request, server-side tags, triggers, and variables determine what happens next.
Triggers define when a tag should run.
Variables provide values from the incoming event or other server-side sources.
Tags send the processed data to the required destination.
For example, a server-side GA4 tag can use data received from the GA4 client and send the event to Google Analytics.
A separate tag can send selected data to an advertising platform.
The Tagging Server and First-Party Endpoint
The tagging server is the infrastructure that runs the server container.
The server container needs a server environment where it can receive and process requests. Google supports server-side Tag Manager deployments using cloud infrastructure such as Google Cloud. Google for Developers
A first-party endpoint can then be used as the URL where the website sends measurement requests.
For example:
https://analytics.example.comUsing a first-party endpoint can place the measurement request within the business's own domain context, depending on the implementation.
How Does Data Flow Through GTM Server-Side Tagging?
The basic flow is:
Website or App → Web Container → Server Container → Client → Triggers, Variables, and Tags → Destination Platforms
For example, consider a customer completing an ecommerce purchase.
The website generates a
purchaseevent.The web container sends the event to the server container.
A client receives and parses the request.
Server-side triggers and variables determine how the event should be processed.
Server-side tags send the required data to the relevant platforms.
The destination platform receives the event.
The important difference is that the browser does not need to communicate independently with every vendor involved in the measurement setup.
Instead, the server container can act as an intermediary between the website and destination platforms.
How to Set Up GTM Server-Side Tagging
A basic setup requires creating the server container, deploying the tagging server, connecting the website to it, and configuring the server-side components.
The exact infrastructure can vary, but the main setup process follows these steps.
Step 1: Create a Server Container
First, create a server container in Google Tag Manager.
In the GTM interface, create a new container and select Server as the container type.
The server container is separate from the existing web container.
The web container continues to operate on the website, while the new server container will handle incoming server-side requests.Support Google
Step 2: Deploy the Tagging Server on Google Cloud or Another Platform
The server container needs an environment where it can run.
Google's server-side tagging documentation supports deploying the tagging server using Google Cloud infrastructure. Cloud Run is one possible hosting option.
The hosting environment needs to handle incoming measurement requests and provide enough capacity for the expected traffic.
Cloud Run uses usage-based billing and automatically scales instances based on demand. The actual cost depends on resources such as CPU, memory, requests, region, and configuration. Google Cloud
The hosting decision should therefore consider both expected traffic and operational requirements.
Step 3: Configure a First-Party Custom Domain
After deploying the tagging server, configure a domain that will be used as the server container endpoint.
For example:
https://analytics.example.comThe custom domain can make the server endpoint part of the website's first-party measurement architecture.
The domain must point to the tagging server correctly, and the server container URL must be used consistently in the relevant web tagging configuration.
The exact DNS and infrastructure steps depend on the hosting environment.
Step 4: Route Web Events with server_container_url
The web container needs to know where to send the measurement requests.
For Google tags, the server_container_url parameter can be used to direct events to the server container instead of sending them directly to Google Analytics.
For example:
server_container_url = https://analytics.example.comThe exact configuration depends on the Google tag and implementation method.
Once configured, the website can send measurement requests to the server container URL, where the server-side setup can process them.Support Google
Step 5: Configure Clients, Tags, Triggers, and Variables
After requests reach the server container, configure the components that will process them.
Start with the required client.
Then configure:
Variables to access event data
Triggers to define when tags should fire
Tags to send data to destinations
Transformations when data needs to be modified or filtered
For example, a GA4 client can receive a GA4 request. A server-side GA4 tag can then send the processed event to GA4.
Other tags can send selected event data to advertising platforms.
The configuration should reflect the required data flow rather than simply recreating every browser-side tag on the server.
Step 6: Preview, Test, and Publish
Before sending live traffic through the server container, test the complete flow.
Use the server container's Preview mode to inspect incoming requests and verify how clients, variables, triggers, and tags process the data.
Check both sides of the implementation:
Website → Server Container → Destination
For each important event, verify:
The event is generated correctly.
The request reaches the server container.
The correct client claims the request.
Required variables contain the expected values.
The correct triggers fire.
Server-side tags execute.
The destination receives the expected data.
Only publish the server container after the complete flow has been tested.
What Does GTM Server-Side Tagging Cost?
GTM server-side tagging has two separate cost areas: Tag Manager licensing and server infrastructure.
The server container itself requires a hosting environment. If Google Cloud is used, services such as Cloud Run are billed based on resource usage.
Cloud Run currently uses usage-based pricing. CPU, memory, requests, and network usage can contribute to the total cost, while the available free tier can reduce costs for lower-volume workloads. Google Cloud
The actual infrastructure cost therefore depends on:
Website or app traffic
Number of measurement requests
CPU and memory requirements
Region
Minimum instance settings
Network usage
Additional cloud services
For a low-volume implementation, infrastructure costs can be relatively limited. High-traffic implementations require more careful capacity and cost planning.
GTM 360 licensing, where applicable, should also be considered separately from the hosting cost.
The important distinction is that hosting the server-side environment and using a Tag Manager license are separate cost considerations.
Benefits, Limitations, and Best-Fit Use Cases
Server-side tagging is not automatically the right choice for every website.
Benefits | Limitations | Best-Fit Use Cases |
|---|---|---|
More control over outgoing data | Requires server infrastructure | Large ecommerce websites |
Centralized data processing | More complex implementation | Multiple advertising platforms |
Can reduce browser-side processing | Requires ongoing monitoring | Complex measurement architectures |
Vendor-specific data routing | Additional hosting costs | Strong data governance requirements |
Can filter or modify data before forwarding | Requires technical expertise | Businesses with many tracking integrations |
Can reduce direct browser-to-vendor requests | More debugging points | High-volume websites and apps |
The strongest use cases are usually environments where the business has multiple vendors, complex event flows, strict data requirements, or a large amount of browser-side tracking.
For a small website with only a few simple tags, the additional infrastructure may not provide enough value to justify the complexity.
Security, Consent, and Data Governance Checklist
Server-side tagging can provide more control over data, but that control needs to be implemented deliberately.
Use the following checklist when designing the architecture:
Security
Use HTTPS for measurement requests.
Protect access to the Google Cloud project and GTM containers.
Limit administrative permissions to the required users.
Monitor server infrastructure and traffic.
Keep server-side components and dependencies maintained.
Consent
Collect consent before processing data where required.
Pass relevant consent signals through the measurement flow.
Apply consent rules before forwarding data to destinations.
Make sure server-side and web container consent configurations are aligned.
If multiple GTM containers are used, consent initialization and conversion handling should be reviewed across the containers to avoid inconsistent behavior. Support Google
Data Governance
Define which data can enter the server container.
Validate incoming event parameters.
Remove unnecessary or sensitive fields.
Define which vendors can receive each data type.
Avoid sending more information than the destination requires.
Document server-side transformations and routing rules.
Review outgoing requests regularly.
The server container provides an additional control layer, but it does not automatically make an implementation privacy-compliant. Consent, security, and data governance still need to be handled as part of the overall measurement architecture.
FAQs
Does GTM Server-Side Tagging Replace the Web Container?
No. Server-side tagging typically works alongside the web container. The web container collects user interactions, while the server container processes and routes the data.
Is GTM Server-Side Tagging Free?
GTM licensing and server infrastructure are separate cost considerations. Server-side tagging requires a hosting environment, and infrastructure costs depend on factors such as traffic, requests, and resource usage.
Do You Need a Custom Domain for GTM Server-Side Tagging?
A server container needs an accessible URL. A first-party custom domain is commonly used for server-side tagging, but the exact setup depends on the hosting and deployment model.