Stape

Google Tag Manager server-side container: client, request, transformation, tag, trigger, variable, event data, etc.

Updated
Jul 11, 2023
Published
Apr 11, 2023
Also available in

Tracking and analytics are crucial in digital marketing, providing valuable insights into user behavior and website performance. Google Tag Manager (GTM) is a powerful tool that simplifies the tracking implementation and management process. 

Most analytics and marketing specialists got used to utilizing the web Google Tag Manager container, which allows managing tracking pixels without inserting them directly into the website code, making tracking setup easier. 

Because the world of web analytics changes rapidly due to tracking restrictions and new ways of delivering data, most web analytics started transitioning from using web GTM to server Google Tag Manager or combining both. 

In this article, we want to dive more into the basics of server-side tagging using server Google Tag Manager. We will explore the fundamental components of server GTM.

What is server Google Tag ManagerCopy link to this section

Server-side tracking using server Google Tag Manager differs from web tracking that uses web GTM mainly because a new intermediary is added - a cloud server. The main goal of the cloud server is to host or run your server Google Tag Manager container. 

When you send data to sGTM, it first gets to the cloud server, and then this cloud server, with the help of sGTM settings, delivers data to third-party tracking tools. 

You can use either web Google Tag Manager, CRM, WebHooks or set up direct requests from your server to deliver data to sGTM. Whether you choose, delivering data to sGTM is based on incoming HTTP requests. 

Depending on what type of data delivery to sGTM you choose, tracking can be:  

  • Pure server-side. It’s when you send data from any server (CRM, webhooks, or your servers) to sGTM.
  • A mix of web and server-side tracking is when you use web GTM to deliver data to sGTM. One popular way to deliver data from the web to sGTM is using Google Analytics 4 or Data tag. 

Server-side Google Tag Manager (sGTM) differs from web GTM in operation, privacy, performance, and complexity.

CharacteristicGoogle Tag ManagerServer Google Tag Manager
Operationin the user's browserserver-side
Privacymore exposedbetter privacy and security
Performancemay slow down the websitereduces browser workload
Complexityeasier to set up and usemore complex

From the structure point of view, the big difference between web and server GTM is that sGTM has two new elements: Client and Transformations. We’ll talk about them further in the article. 

The Building Blocks of server GTM - Clients, Requests, Transformation, Tags, Triggers, Variables, Event Data, etc.Copy link to this section

Before diving into setting server GTM containers up, it's essential to understand the building blocks within. At first, the interface of sGTM looks very similar to the web one, and you might notice common elements. But the difference between these two is vast, not only because sGTM has a few new elements but also because of the logic of how sGTM operators.  

Data can be delivered to sGTM as an incoming HTTP request (1). When a Client (2) claims an incoming HTTP request, data within the HTTP requests are processed and categorized into the event data that tags, triggers, and variables can use. There is a possibility to use transformation before any data in sGTM gets tagged. Transformation is an intermediary between clients and tags. It can be used to exclude or include any parameters before a tag can access it. Once a tag is triggered, it sends an outgoing HTTP request (3) to a particular vendor. 

server google tag manager explained

RequestCopy link to this section

There are two types of requests in server Google Tag Manager: 

  • incoming HTTP requests to receive information.
  • outgoing HTTP requests to distribute information from sGTM containers to corresponding platforms.

ClientCopy link to this section

A Client's function is to listen for incoming HTTP requests, convert requests into event data, and respond to the requests. Once the Client processes the request, it makes data inside the request usable for tags and triggers of the server Google Tag Manager container. 

Clients operate based on their Priority. One client can claim a request, but multiple clients can try to claim the same request. The priority determines which client to claim the request. Clients with a higher priority would be activated for the request. 

There are only 5 default clients available in sGTM, and unfortunately, there is no possibility to add clients from the sGTM template gallery.

default clients in server google tag manager

TransformationsCopy link to this section

Transformations act as an intermediary source between a client and a tag and allow adding or removing event data before the tag can access it. 

transformations in server google tag manager

TagsCopy link to this section

The tag's purpose is to take this event data object, map it to the correct format, and then dispatch it to the servers of the network they designed to deliver data. For example, the Google Analytics tag delivers data to Analytics servers, the Facebook tag to Facebook, etc.

There are several default tags in sGTM; many server tags are also available in the sGTM template gallery. You can also find Stape's complete list of tags here: https://stape.io/solutions/tag/sgtm-tags

TriggersCopy link to this section

Triggers determine when and how tags are fired. They define the conditions that must be met for a particular tag to execute. Setting up triggers ensures that the proper tags are activated at the right time, capturing the desired user interactions.

VariablesCopy link to this section

Variables are used to parse incoming HTTP requests and get specific data from the request for tags, triggers, and clients.

Event dataCopy link to this section

After the client parses the incoming HTTP requests, it structures information into the Event Data that variables can use. The event data concept is similar to the Data Layer in the web Google Tag Manager.

event data in server google tag manager

Preview modeCopy link to this section

Preview Mode helps you test and troubleshoot your setup before publishing. It lets you see which tags are being fired, their order, and the data they're sending - all in real time. It helps ensure your tags are working as intended before they go live.

Debug Mode provides additional details about each request and response, allowing you to check data and tag configurations for potential issues.

ConclusionCopy link to this section

In conclusion, understanding the vocabulary associated with Google Tag Manager is essential for effective tracking and analytics in digital marketing. By comprehending the roles of clients, requests, transformations, tags, triggers, variables, event data, etc., you can harness the power of sGTM to gather valuable data, optimize marketing efforts, and improve user experiences. Explore the capabilities of Google Tag Manager to unlock a world of tracking possibilities and empower data-driven decision-making.

If you’re confused, we will save you from the headache. Don’t hesitate to contact us!

Thanks for reading.

Need help setting up server-side tracking?

We've got you covered! Click Get assistance, fill-up the form, and we will send you a quote.

Get assistance
Tagged with:gtm server

Host your GTM server at Stape