Skip to main contentSkip to footer
Podcast

How does Server-Side Google Tag Manager (sGTM) work?

In this episode, it’s business as usual. The duo of Tobias Rast and Leopold Strauch explains how Server-Side Google Tag Manager—or “sGTM” for short—works. It’s business as usual in that Tobias Rast takes on the role of host as usual, while Leopold Strauch, as a software engineer, shares his expertise on the topic.

PM26 – How Does Server-Side Google Tag Manager (sGTM) Work? – with Leopold Strauch #TechnologyExplained

This episode is about:

  • How does the classic GTM work, and what are the issues with it? (01:39)
  • Solution to Problems with Traditional Tag Management (Data Loss): Just Switch to Server-Side? (7:35)
  • Solution = Revolution (11:50)
  • sGTM vs. Traditional GTM: Step by Step (13:32)
  • What does my store need to do to use sGTM? (28:49)
  • For me, partner marketing with server-side GTM is… (38:21)

How does the classic GTM work, and what are the issues with it? (01:39)

As an online store, you have many different tracking technologies that you want to integrate into your website. Installation and changes always involve a lot of hassle. With GTM, marketers can manage their own tags.

Problem: This no longer works from a technical standpoint, sometimes resulting in data loss of 30–60%. Why? Because everything is configured through Google, which means you’re also embedding a Google container into your website (a third-party component), and that creates a single point of failure.

The conflict in a nutshell: Browsers aim to protect users' privacy, and Google Tag Manager is the world's most widely used tracking tool.

Solution to Problems with Traditional Tag Management (Data Loss): Just Switch to Server-Side? (7:35)

Server-side tracking traditionally works using IDs, such as ClickIDs or similar, which are sent to the store when a user clicks through. The store stores this ID and sends it back to the tracking server via the conversion tag on the server side. Disadvantages: This usually requires a developer for implementation, which means extra effort! And: A lot of data is missing here, such as metadata from the browser (device, IP, cookies), so you have to rely on individual parameters, e.g., for attribution. 

Solution = Revolution (11:50)

So: Actually, a combination of first-party and server-side tracking would be THE ideal solution. The jack-of-all-trades, so to speak: Server-side Google Tag Manager (server-side GTM) offers just that!

The familiar user interface is supplemented by a server-side container. Here's how it works:

The container is loaded not in the client but in the server instance. The server-side GTM container can then execute its logic. In other words, the container is moved from the user's browser to a separate server.

sGTM vs. Traditional GTM: Step by Step (13:32)

Traditional GTM works like this:

  1. The store is loaded from the server (user visits the store)
  2. JavaScript (GTM) is running on the store
  3. The container is being loaded from Google's infrastructure
  4. The container runs, processes data, and triggers events within the container
  5. These events are listened to; triggers are fired
  6. Tags listen for triggers and execute scripts 
  7. Data is sent to other servers

Server-Side GTM 

  1. The store is loaded from the server (user visits the store)
  2. Client-side: JavaScript (sGTM) is executed on the store. New feature: Forward data to your own server (acting as a proxy, so to speak)
  3. The script is loaded from our own infrastructure (first-party, our own domain)
  4. Data is sent to our own server (our own domain or wherever the sGTM container is running) via a standard HTTPS request. Metadata (cookies, headers, etc.) can also be included. The JavaScript acts as a data collection point, so to speak.
  5. The server listens for incoming HTTPS calls. Next comes the client—a new component in the sGTM ecosystem—which translates the data back into the GTM ecosystem and converts it into GTM events. In other words, the media break is masked. These events are used, for example, for triggers. Examples of such events include: page loaded, purchase, etc.
  6. Triggers can now listen for events; for example, if the "Purchasing" type is triggered, they can perform an action (execute a task).
  7. The request is executed on the server side, meaning the client (browser) is no longer required. Execution is relatively synchronous, and all data and metadata can be passed along (HTTP headers, cookies).
  8. An even bigger advantage: The server (which receives tag information) can send a response back to the user/browser via the client (sGTM). For example, it can set a cookie.

What does my store need to do to use sGTM? (28:49)

You need your own infrastructure (the client should run on your own server) and you need a subdomain that redirects to that server. The container (Google software) must run on this server and be configured to receive the correct information for operating sGTM. But don’t forget about server maintenance: administration, ensuring it runs smoothly, and keeping the software up to date.

In other words, if you “simply” set up a server on Google Cloud, you’re responsible for its operation. You also need to consider reliability, since the central tracking and data tool must always be available. These are the kinds of tasks typically handled by professional web hosting services.

So if you can’t or don’t want to manage the server yourself, you’ll need a managed server hosting service. To make sGTM accessible to everyone, Ingenious offers sGTM hosting, leveraging its many years of expertise with tracking servers. This means Ingenious handles the hosting, and as a shop owner, you don’t really have to do anything except define the sGTM domain.

Conclusion: sGTM provides effective tracking for everyone and solves many of the industry's problems quite easily.

For me, partner marketing with server-side GTM is… (38:21)

… the only way to ensure effective tracking in the future.

More articles

More articles