Guide to Setup Server Container in Google Tag Manager

A client-side tracking website uses a container on the page to transfer measurement data to multiple third-party tracking platforms. This container operates on the user’s browser and has a direct connection to your tracking tools’ mother server. Server-side tracking bridges the gap between the two by allowing you to develop your own tracking server. Google Tag Manager server-side tagging is hosted on the servers (Like: Google Cloud Platform, Stape.io, or your own server) and functions as a middleman between your client-side tracking and marketing vendors. Data is delivered from the browser to the GTM server-side instance and then forwarded to your tracking tools. This allows you to control data from being sent to your tracking tools and save data resources, resulting in a better user experience. In this blog, I will walk you through the process of configuring Google Tag Manager server-side tagging.

A client-side tracking website uses a container on the page to transfer measurement data to multiple third-party tracking platforms. This container operates on the user’s browser and has a direct connection to your tracking tools’ mother server.
Server side tracking bridges the gap between the two by allowing you to develop your tracking server side container. Google Tag Manager server side tagging is hosted on the servers (Like Google Cloud Platform, Stape.io, or your server) and functions as a middleman between your client-side tracking and marketing vendors.
Data is delivered from the browser to the GTM server-side instance and then forwarded to your tracking tools. This allows you to control data from being sent to your tracking tools and save data resources, resulting in a better user experience.
In this blog, I will walk you through the process of configuring Google Tag Manager server side tagging.

The most common way GTM is used

To understand how server side tagging works, let’s start with the setup/process that most of you are already aware of. If you want to install Google Tag Manager on a site, you must include the web container’s JavaScript snippet in your site’s source code.
The GTM snippet loads with the rest of the page and fires tags based on your configuration when the page loads. One of these is the Google Analytics 4 tag. All of this occurs on the client side (in the user’s browser). JavaScript codes load, collect data and then send it to another location. The GA4 snippet, for example, transmits data to google-analytics.com.
Tracking codes typically acquire additional information about the website, device, and so on, in addition to the data you requested Google Analytics to collect (e.g., the click URL of the button).
Some scripts are more sensitive to privacy, while others are more aggressive and do fingerprinting, use first-party cookie information, and other nefarious activities for cross-site tracking.

Is your Server Side Tracking correctly implemented?

Let’s start with us.

Now let’s explore more about Server Side Container.

The server side method

Server side tracking is a data collection technique where data is sent directly from a server to a data collection server. This contrasts with client side tracking, which sends data from the user’s device to the data collection server.

In Server side data management, the data is directly sent from the website’s first-party domain to the GTM container which consists of the tags setup for various events. Then the tag fires based on the triggers setup for it (eg. Button Click, Link Click, Call Click etc.). Then the data is sent to the Cloud server (like stape.io, Google Cloud, or another server). Once the data is sent to the cloud server, then the data is sent to the third-party tracking platform (like Google Analytics 4, Facebook, Pinterest, etc).

Server side tracking has several advantages. Firstly, it isn’t as easily blocked by browsers or devices and hence is a more reliable tracking method. Secondly, it provides more accurate data by collecting it directly from the server, offering a more comprehensive view of user behaviour. Lastly, it enhances user experience by shifting data processing from the user’s device to the server, which can improve performance.

What is Server Side Tracking and Why must you implement Server Side tracking on your website?

The Advantages of Server Side Tagging

Server side tagging has several advantages over client side tagging, including:

  1. Improved data collecting and conversion tracking. Server side tagging can assist in reducing data loss as a result of ITPs, iOS restrictions, and ad blockers. It can also improve conversion tracking accuracy by allowing you to track conversions across numerous devices and browsers.
  2. Website performance has improved. By minimizing the number of scripts that must be loaded in the browser, server side tagging can improve website performance. This can result in faster website load times and a more pleasant user experience.
  3. First-party cookies and extended cookie lifetime. Server side tagging allows you to set first-party cookies, which are less likely to be blocked by browsers and ad blockers. It can also help to extend the lifetime of cookies, which can improve data collection and tracking.
  4. Control what data each vendor receives. With server side tagging, you have complete control over what data is shared with third-party vendors. You can choose to remove or modify data before it is sent, or to only share data with certain vendors.
  5. Governance and control. Server side tagging gives you more control over your data and how it is used. This can help you to ensure compliance with data privacy regulations.

In addition to these advantages, server side tagging can also help you to:

  1. Reduce the impact of ad blockers. Ad blockers can block client side tracking scripts, which can make it difficult to collect data and track conversions. Server side tagging can help to reduce the impact of ad blockers by allowing you to collect data and track conversions even if users have ad blockers installed.
  2. Enrich data. Server side tagging allows you to enrich your data by combining it with other data sources, such as CRM data or customer data platforms. This can help you to better understand your customers and their behaviour.
  3. Hide tracking IDs and secret API keys. Server side tagging can help protect your tracking IDs and secret API keys from being exposed to the public. This can help to improve the security of your data.

Overall, server side tagging offers several advantages over client-side tagging. It can help you to improve data accuracy, website performance, data governance, and security.

Automatically provision tagging web server vs manually provision tagging web server

There are two ways to configure your tagging server to enable server side Google Analytics tracking.

AUTOMATIC PROVISION

Google will immediately set up a new web server for you on the Google Cloud Platform using this method. It’s a pretty simple procedure; simply follow the on-screen prompts and you’ll be ready to go in no time! You will, however, need a billing account linked to the Google Cloud Platform, so if you don’t already have one, get one.

MANUAL PROVISION

This technique is intended for websites or users who prefer to use their servers and do not require the tagging server to be set up using Google Cloud Platform, such as your own AWS Servers or a managed hosting service. This method requires a bit more setup, so you may need to review the Server Side App Engine Setup Guide for more details.

Are you facing an issue while setting up Server Side Tracking?

Let’s start with us.

How to Properly Configure GTM Server Side

Now, let’s get started with your initial setup. I’ll attempt to keep things as easy as possible (even though they are more complicated in reality).
In a nutshell, the procedure is as follows:

  1. Create the Server Side Container
  2. Configure GTM on the server side
  3. Configuring the Server Container
  4. Configuring Google Analytics 4 Tags
  5. Test and double-check

1. Create the Server Side Container

  • Navigate to your Google Tag Manager account.
  • Select Create Container.
  • Enter your domain name.
  • Choose a server.
  • Press the Create button.
  • Accept the terms and conditions.

The SERVER container’s default Workspace is now visible.

Server Container Setup

Server-side tracking is a data collection technique where data is sent directly from a server to a data collection server. This contrasts with client-side tracking, which sends data from the user’s device to the data collection server. Let's learn how to implement it.2. Configure GTM on the server side

  • On the upper left, click the Admin tab.
  • Next, select Container Settings.
  • There is an empty field labelled Server container URL there.
  • Click the Set up your tagging server button under Tagging server.
  • Select Manually provision tagging server once inside.

GTM Setup on Server Side

Server-side tracking is a data collection technique where data is sent directly from a server to a data collection server. This contrasts with client-side tracking, which sends data from the user’s device to the data collection server. Let's learn how to implement it.3. Configuring the Server Container

  • Navigate to Clients in the newly constructed SERVER container.
    The most essential piece is the ‘clients’ section, which is specific to GTM server side tagging.
  • Navigate to Variables.
  • Select Configure once inside.
  • Once inside, choose and check all of the Built-In Variables. ‘Client Name’ is the most significant variable here.

Server Side Configuration

Server-side tracking is a data collection technique where data is sent directly from a server to a data collection server. This contrasts with client-side tracking, which sends data from the user’s device to the data collection server. Let's learn how to implement it.4. Configuring Google Analytics 4 Tags

  • Navigate to Tags.
  • Select New.
  • Give your tag a name. Then select the Edit icon.
  • Choose Google Analytics: GA4.
  • Click the edit icon under Triggering.
  • Select the Add a Trigger option.
  • Give your trigger a name. Click the edit icon button and give a name to the trigger, for example, GA4 Trigger.
  • Choose Custom.
  • Then choose Some Events.
  • Modify the parameters as follows: Client Name > Contains > GA4

GA4 Tag Setup

Server-side tracking is a data collection technique where data is sent directly from a server to a data collection server. This contrasts with client-side tracking, which sends data from the user’s device to the data collection server. Let's learn how to implement it.

GA4 Trigger Setup

Server-side tracking is a data collection technique where data is sent directly from a server to a data collection server. This contrasts with client-side tracking, which sends data from the user’s device to the data collection server. Let's learn how to implement it.5. Test and double-check

  • Refresh the preview mode in your server side container (by clicking the “Preview” button again in the GTM UI).
  • In the GTM container, enable the Preview mode.
  • To begin, a Pageview tag in your web container will fire (if set to fire on All pages).
  • Check the Network tab of your browser’s developer tools as well. To find the request, type “/collect” (without the quotation marks). Assume you can’t reload the website again (while /collect is still in the search box). The request should be routed to your container’s domain (which should include […]appspot.com) rather than to google-analytics.com. If the status of this request is 200, everything is well.
  • Then, in the server GTM container’s preview mode, check to verify if the request was received. If this is the case, it will appear on the left side of the preview mode.
  • Check to see if the GA4 tag in your server container fired. You can view the data given to Google Analytics by clicking on the tag.
  • Examine the preview mode’s other tabs, such as Event Data.
  • Finally, check your GA4 real-time reports to see if the data is displayed (it should be).

Don’t forget to publish the server container after everything is ready.

Want to Setup Server Side Tracking on your website

Let’s start with us.

Server Container Preview Mode

Server-side tracking is a data collection technique where data is sent directly from a server to a data collection server. This contrasts with client-side tracking, which sends data from the user’s device to the data collection server. Let's learn how to implement it.

Learn the simplest way to Check the Server Side tracking implemented on the website.

Summary

Should you begin integrating server side tagging in your projects right away?
The answer is “it depends”. Invest in server-side tagging if you want to manage what data marketing/analytics firms acquire.
Choose server-side tagging if you wish to lessen the impact on page loading time (while doing the heavy lifting on your server).
If any of the additional benefits listed in this post spoke to you. SGTM is designed for you.
However, if your analytics/marketing needs are very basic, and you only check your statistics to see what the most popular pages are or where the majority of your traffic is coming from, server-side GTM may be too much of an investment because it will incur additional expenditures.

I am also available here!

| Incisive Ranking
| Incisive Ranking
| Incisive Ranking
| Incisive Ranking

Follow Us:

About Us

We are experts in Tags and Tracking Services. With experience in eCommerce and Custom Conversion tracking, Server Side Tagging, and Data tracking to help you get the advantage of ACCURATE data for better decision making. With more than 6 years of experience, We have already delivered more than 500 projects.

Copy link