English Posts

Server-side Tagging: what is it?

gtm server side

Update: October 5th. Google Tag Manager Server Side is officially out of Beta, as confirmed by Google, and has entered a new phase.

Announced in August 2020, Google Tag Manager Server-side is still a tool / theme unknown to most.

There are many doubts and questions on the subject and in this post I want to clarify a bit to better understand what it is.

The argument is related to what is happening in recent years on the limits to third-party cookies, concerning both the limitations that browsers are imposing and what Safari is carrying out with the ITP theme.

The main question is: can we save ourselves with server-side tracking?

Let’s try to better understand the working process and give an answer.

How does server-side tracking work?

To understand how server-side tracking works, let’s recap what a tipical architecture can look like in Google Tag Manager.

When I talk about “tipical” I mean a client-side container.

The information collected in Google Analytics, through GTM, are sent to the Analytics servers, according to this scheme:

client side gtm tracking

With the new server-side mode I will always have a container in GTM on the client side, but we add an extra step that is a cloud with a first-party domain, which will host the GTM server-side container:

gtm server side

In practice, a part of the actions will always take place on the client side (in the user’s browser) and another part in the cloud server.

What is the process to follow to configure GTM server-side?

There are a number of steps to follow for the correct configuration of both the domain that will host the server-side container, and the client-side container tags that we want to communicate with the server-side GTM.

  1. Container creation and cloud project in the Google Cloud Platform. In addition to the client-side container, you need to create a new Server-side container directly in GTM, selecting the “Server” option
google tag manager gtm server container

Then, create a new project within the Google Cloud Platform, entering directly from GTM:

tagging server GTM

2. Verify, map and connect the custom domain. As soon as the project is created, Google will provide us with a first domain (it is from Google because it contains appspot.com), with the aim of seeing if the first configurations will be correct. However, to have a first-party context to work within and leave the third-party context provided by Google, we will need to create our own domain. This means that, if our site is www.mysite.it, then we will have to create a subdomain like www.gtm.mysite.it which will host the server.

gtm tracking cloud

3. Create the Clients. Clients are the key tool for the server-side container. Let’s say they have the same importance that the data layer has in the development of client-side tracking. Clients process incoming requests and make the information available to server-side tags.

gtm server domain cloud

4. Update the tracking setting to send data from the site to the server. Set the first tags so that the information collected is not sent directly to third-party suppliers (eg: Google Analytics, Facebook etc.), but to the created endpoint (in our example gtm.mysite.it).

gtm server request url

5. Test incoming requests. Once the first tags have been created, it is necessary to verify that the requests are received and processed correctly.

client request gtm server side

6. Send the information from the server-side container. The tags are set so that the information is sent to suppliers, directly from the server and no longer through the user’s browser. We can use multiple tags to process information arriving at a single Client.

gtm server client and trigger

7. Upgrade to App Engine Flexible and publish the changes. If you have developed everything through GCP, the most flexible solution is to switch from App Engine Standard to App Engine Flexible. Once this is done you can publish the changes in production.

app engine flexible gtm server

8. Cost monitoring and optimization. Once everything has been published, some sort of audit has to be planned. We need to monitor costs and understand where to optimize. In practice, this means looking at the number of instances and seeing if there are enough or too many. Monitor responses from the server hosting the container and send what is needed. Optimize the tracking structure, for example by using a Client for multiple tags and not a Client for each individual tag (sometimes this is not possible because it depends on whether the tags support a certain type of Client).

9. Increase implementation. With constant monitoring of server-side and client-side activity and tracking, you can move on to increase the server-side implementation and create additional customizations such as, for example, loading the gtm.js and gtag.js from the first-party domain and not via GTM

Why use GTM Server-side? Pros and cons

There are several benefits with a server-side implementation.

  1. Reduced page load time. There will be fewer scripts that are loaded, because the main place where you can check the information will be the Server and not the Browser. While in the client-side implementation each tag needs a dedicated script;
  2. Greater control over the type of data sent to vendors. It will be possible to decide which data to send to the third-party tools, cleaning up some information, but also adding others (for example by allowing the CRM talk to the Clients);
  3. Greater control over PII (Personally Identifiable Information). Easier to control the collection of personal information and avoid its collection;
  4. Maggior controllo sulle PII (Personally Identifiable Information). Più facile controllare la raccolta di informazioni personali ed evitarne la raccolta;
  5. Extension of the expiration of cookies on Safari. By acting on a first-party context (the server hosting the server-side container), there will be fewer limitations on the cookie of iOS users;
  6. Reduction of the impact of ad-blockers. Often some ad blockers also stop requests to Google Analytics. The first part context allows us to reduce these blocks.

However, all that glitters is not gold and there are a number of drawbacks or perhaps possible limitations to this type of implementation:

  1. Know-how. The implementation of the first-party domain that will host the server-side container requires knowledge that often requires interfacing with the IT department;
  2. Costs. Depending on the volume that the website has, there are maintenance costs to be faced that can be around a ranging from € 50 to € 200 per month. A detail for the Google Cloud Platform part can be found at this link;
  3. Maintenance. It is not a solution that is put on its feet and walks by itself. This isn’t true for client-side implementation either, but with a server-side container it’s even more true. A step-by-step implementation process must be followed to understand how much it impacts on server maintenance costs and how to optimize costs. The effort of hours is to be taken into account!
  4. Solution in development. The package is not yet complete. Many vendors have not yet developed solutions for a server-side implementation. So until they do, it will be impossible to think about migrating 100% to a server-side container;

Parallel implementation: tips

“Double” tags

When it comes to running the two implementations at the same time, in practice it is a question of having “double” tags.

Some tags set to collect the information that passes from the Browser and some others that collect the server-side data.

This means having the same trigger and variable settings for both types of tags.

Using Folders in GTM

A good tool to organize this work is to use Folders in GTM and collect duplicate tags to have everything under control.

Identical Settings in the GA Properties

In addition to this, you need to check that the Properties in Google Analytics have the exact same settings (cross-domain tracking, referral exclusion list, Conversions, Filters etc.).

Number of Users

When we have some data, check the number of Users in the different GA Reports: be careful not to be frightened if the number of New Users is different and higher in the Property that collects the server-side data, compared to the Property client-side.

The number of Users must be almost similar between the two Properties. It is normal for the number of New Users to be higher in the Server-side Property, precisely because it has been running for less time and users are considered “new” by the cookie.

Event metrics

We will then need to check the Event metrics between the two Properties and see what the difference is.

URL Pages

Another check that I recommend is to download, in the dedicated Report, the URLs of the most viewed pages: on the one hand from the client-side Properties and on the other from the server-side one.

The purpose is to check that there are no pages that do not appear in either of the two Reports.

This can be useful for understanding why there are shortfalls on aggregate metrics.


Once you have done this implementation path, you can decide to stop the client-side tags, change the destination of the server-side tags to send the data to the main Property used and switch to the server-side implementation only.

But the question arises: does it make sense to move 100% to server-side GTM?

The answer for now is no. The tool is not yet structured to have a valid tracking like the one we know today (client-side).

Update 6th November: even if the version has been out of Beta since the end of September, at the moment not all vendors have tags that can be used for the tracking server. So, I remain of the idea that going 100% to server mode is not the best choise yet.

However, the sooner we know it, the sooner we master it.

So my advice is to approach server-side tracking and concretely understand all the potential it can offer us!

Share your opinion and tell me what you think!

Good analysis!

You may also be interested by the following articles:

  • Google Analytics 4: source/medium report
    One of the most popular reports within the Universal Analytics version is definitely the Source/Medium Report. In this Report, you can quickly observe the source and medium of users landing on the website. In UA we can find it under Acquisition > All Traffic > Source/Medium The new version of GA4 offers many features but […]
  • Landing Pages Report in GA4
    One of the most interesting reports in Google Analytics – Universal Analytics is the Landing Pages Report. In this report you can observe the first landing page of a user on the analyzed website. It’s a very useful report to quickly understand what our user’s entry points are. However, the question may arise: how do […]
  • Google Analytics 4: Comparison
    In this post, I’ll show you how to compare data in Google Analytics 4. Just as with the UA (Universal Analytics) version, where you can use segments to better analyze your users’ behavior on the site, GA4 offers a similar feature. However, there are some nuances, compared to the UA version. Compare data in GA4 […]
  • Search Console and Google Analytics 4
    In this post I will show you two things that I find very useful: Connect the Google Search Console directly to your Google Analytics Property 4 Save a widget for faster access to Search Console data in the GA4 User Interface Let’s start! How to Link Search Console to GA4 Property The steps to link […]
  • How to Change Language in Google Data Studio
    Google Data Studio is a great data visualization tool that is completely free, allowing you to connect different data sources to create dashboards. Some of the available data sources are: Google Analytics Google Sheets Google BigQuery File in .csv etc. The sources are different and, as you have seen, they are not only from the […]
  • How to Implement Content Group in Google Analytics 4
    Content Groups allow you to create sections of the website, grouping contents in a convenient way for your analysis. Let’s give some examples: I can create a specific group that shows me the most viewed Brands on my website or I can create Product categories to analyze, at a higher level, the interactions of users […]
  • Server-side Tagging: what is it?
    Update: October 5th. Google Tag Manager Server Side is officially out of Beta, as confirmed by Google, and has entered a new phase. Announced in August 2020, Google Tag Manager Server-side is still a tool / theme unknown to most. There are many doubts and questions on the subject and in this post I want […]

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *