Server Side-Tagging, The Future of Analytics

Table of Contents

There has been a lot of hype regarding server-side tagging (SST) in Google Tag Manager since it was introduced by Google in 2020. Some say that it is the future of analytics, and it may very well be. Although there are a few setbacks, this new modality has a lot of advantages. The intention of this post is to make an introduction of server-side tagging more than a comprehensive how-to guide, which I’m sure you can find out there. 

So let’s dive in.

Client-side Tagging. The traditional way

We all know that in order create good marketing campaigns we need to collect data about what our users are doing on our website. To do this we use tags, which in essence are snippets of Javascript. These scripts allow us to collect the data that we much need for Google Analytics, Facebook Pixel, and other 3rd party tools that we might be using. 

Typically, the way this has been done is by having a web container run in our client’s web browser (AKA the client-side), which means that the data is collected and processed in the browser that our client is using to visit our website. 

One such example is Google Tag Manager. If you have ever installed Google Tag Manager on a website then you will have noticed that you need to insert a script (the container), in the HTML of your site. Hence, this means the container lives on your website.

When our clients (users) interact with our website, the different tags that we configured fire and start collecting data. The data is then sent from the client’s browser to the different parties that need it.

Warning: there is a new server-side feature in Server Side GTM containers called “Clients” so don’t get it confused with the concept of Client-side meaning the browser that the client uses. 

 Here’s an illustration of how the traditional way works.
As you can see, your container lives in the website itself, and, from there, the data is sent to different parties. One of the disadvantages of the old way is that each and every script has to load on the page and this is not good for speed and user experience.

Server-Side Tagging: The new & improved way.

Server-side tagging is an improved way of tracking our users’ behavior across platforms and devices with Google Tag Manager using our own server to collect and process the data instead of using our client’s browser. This new model enhances security and improves the user experience. The core idea of SS GTM is that, instead of having your container live on the browser, it runs on your own server. Which, as of right now, means that it would be running in a Google Cloud Platform project. Why this extra step you ask? Well, we will get into the nitty-gritty of it but, for starters, this means that the data can only be accessed by you on this server. This gives you full control of the data. You have the choice of processing it before you send it somewhere else.

The key differentiator of SS GTM is security. The Tags are built using the Sandboxed Javascript technology, which removes and restricts some features of JS to make the execution environment safe. This new technology also provides a way to set permissions and policies to control where your data goes. So, it sounds amazing but, how does it work?

For starters, you can have your own server’s custom domain. In the traditional way of tagging, once the data was collected from the website, when it was sent, for example, to Google Analytics, it was sent to the domain google-analytics.com/collect. Now, you can have your own subdomain to send the data to, e.g. data.yourdomain.com. This has some advantages that we will discuss later. 

Events, tags, triggers, and variables are concepts that have been around for a long time. 
  • Tags are JS scripts that send us event data
  • Triggers fire these tags based on events conditions
  • Variables are placeholders for values that you want to obtain.
In Server Side Tagging one of the main things that has changed is that instead of events triggering the process, it now all starts with an HTTP request sent to our server from our client’s browser. The tricky part is how SS GTM converts these requests into the events that we are familiarized with. Enter, “Clients“.
 

Server Side GTM Clients


This misfortunate homonym adds a little more to the confusion. “Clients” in SS GTM are the parts of the new GTM that transform HTTP requests into an event data object. Once the data has been transformed into events, our tags, triggers, and variables can work with the data objects they are used to working with. So to summarize, Clients process & convert data from HTTP requests into the event data object that we have always known and love.

There are different measurement protocols for different data streams, the way to sort all of this data is through the clients. They process the data, convert it to events and make it available to tags, triggers, and variables. Each server container comes with two different clients included by default: Google analytics 4 and Universal Analytics. 

Here’s an illustration of how server-side tagging works.

As you can see, the server functions as an intermediary between the data and third parties. 

 

Benefits Of Server Side Tagging

Well, now that we know a little about how server-side tagging works, let’s answer the question why would I use it? Well, there are many benefits to adopting this technology.

Reduced page load time

We are all aware that the faster a site loads the better the user experience. And it is also well known that the more scripts you have loading on your website, the slower your site will be. Here’s where SS tagging gets interesting. Since all the scripts in the container live in the server and not in the browser, less JavaScript needs to be executed in the browser. This will increase the speed of the website making your users happier in the process.

Control Over Data

This is a big one. In the traditional way, third parties get the information directly from the user’s browsers which can lead to leaks of personally identifiable information (PII), like names, addresses, login details, or in a bad scenario a credit card number. But with SS tagging, the worst that can happen is that these leaks of information end up in your server. Obviously, it would be better not to have them but at least it won’t fall into the hands of third parties. In your own server, you can clean up the data and make sure that there are no more leaks before sending that data to a third-party vendor.

First Party Cookies

Remember how we talked about sending the data to your own subdomain? Well, this has a lot of advantages. First, there are the adblockers. Adblocking is not an uncommon thing and they have learned through experience which domains to block requests from, Facebook, Google Analytics, and basically all of the ones that are well known. They don’t, however, block requests sent to your own domain, at least for now. Once you have the data in your power, you will decide where to send it. This first-party context also allows you to extend the expiration of cookies on safari, which will give you advantages with iOS users.

The Negative Side of Server Side Tagging

So far it seems like Server Side GTM is something everyone should be using but there are some cons that are not to be taken lightly.

Cost

We were used to using GTM completely for free. And it is not like Google is charging now, you can still use Server Side GTM for free. However, the hosting of the server is not free and for a website getting lots of traffic is not going to be cheap. So how much will it cost for you? The truth is it is not easy to say, it depends on a lot of factors. You can check the prices directly on the Google Cloud Platform.

Technical Side

Analytics in general requires technical knowledge. And server-side GTM requires a lot more technical knowledge than its current alternative on the browser side. To properly implement it you will need the help of developers and IT support. This is especially hard for SMEs that have neither the technical background nor the means to pay for the much-needed technical support.  

So, Is Server-Side Tagging The New Way?

Although there are divided opinions on this subject, a lot of thought leaders in the analytics community seem to believe that the server-side is where the industry is heading. And you can see it happening in other areas of analytics too. Take Facebook for example. The Facebook Pixel is a piece of code that traditionally collected data right on your website, on the browser side. But Facebook also has the Facebook Conversions API, which allows you to send both web and offline events (phone calls information for example) from your server to the Facebook server. Sounds familiar? Actually, Facebook Conversions API is not new, but since the iOS privacy features got stricter, it has become a lot more useful for marketers. 

Conclusion

Ok, so server-side Tagging obviously looks like the future of analytics. And the more strict the regulations get, the more we will need to migrate to this new form. However, in my opinion, there is a philosophical side to it. One of the things I’ve always loved about digital marketing is that it allows small companies without big budgets to compete leveraging their creativity & talent. There are many stories about small brands that became huge by inspiring people. The fact that server-side tagging is so technical makes it difficult for SMEs to adapt. So this will create a gap between large companies & SMEs without an IT team or resources to implement it. But I guess this is a side effect of improvement. The truth is that SS tagging has a lot of advantages comparing it to the traditional way.