How to start with server-side tracking

May 14, 2024
Feb 26, 2022
Also available in

With the constant evolution of online advertising come new difficulties. One of these is server-side tracking, a tool for monitoring user behavior on websites that employ cloud servers instead of user browsers. It appeared in 2020, meaning it’s pretty new, and not many people have dived into it precisely. 

So, if you start a new marketing initiative and decide to run some advertisements on social media, you definitely have to know about this new tracking method. We decided to make this blog post for beginners in the server-side world. Here you can find server-side tracking benefits, a brief overview of the most popular platforms that support server-side tagging, a discussion of different use cases, and the advantages of Stape servers for sGTM. 

1. What is server-side tracking?Copy link to this section

If, like many organizations today, you are unhappy with inconsistent analytics data and/or worry about data ownership and privacy, server-side tracking may help with some of your problems. So let’s take a closer look at how it works.

With server-side tagging, data is shared between tracking platforms and third-party vendors through the cloud server. It eliminates the use of the user's browser. A server container operates on a cloud server under your control instead.

server-side tracking

The introduction of the Server Google Tag Manager container considerably affected the popularity of server-side tagging. Using the sGTM interface, you can implement server-to-server tracking for the most popular platforms. You can also use web GTM as a data source for your server GTM container. To feed data to the server GTM, you can use either Google Analytics 4 or Data Tag/Data Client.

Despite appearing similar to the web (client-side tagging), the server GTM container uses server-side tracking, which operates on a completely different logic.

2. What are server-side tracking benefits over client-side tracking?Copy link to this section

Client-side tracking is a traditional form of tracking in which analytics providers communicate directly with the user's browser. Tracking tags are activated, the container loads simultaneously with the page load, and all interaction data is delivered to analytics providers. This means the page is overloaded + the speed of the page decreased sharply + problems with security and third-party cookies appeared.

browser tagging with google tag manager

That’s where server-side tagging comes to a rescue! Server-side tracking can manage data loss caused by ITPs, iOS limitations, and AdBlockers, as well as speed up your website and protect the data.

In the case of ss tagging, an intermediate point (cloud tagging server) is added. Cloud tagging server processes the request instead of the client browser. The request goes first to the cloud server, then the server processes it and sends it to a third-party system.

server-side tagging with google tag manager

3. Server-side tracking using server Google Tag Manager.Copy link to this section

There are several tools you can use for setting up ss tagging. Our choice is the server Google Tag Manager container. The main advantages of using sGTM, in our opinion, are:

  • easy to use.
  • transparency and convenience.
  • no additional costs. You should pay only for servers, no fees to using sGTM interface.
  • version control system. Any changes can be easily undone and returned to an earlier state, as well as keep track of who made the changes, where, and when.
  • multi-user mode

Please visit this blog post if you want to set up Google Tag Manager Server-Side tagging on your website.

4. Why Stape is the easiest and cheapest way to start with server-side trackingCopy link to this section

Using Stape, you can set up server GTM in less than 1 minute, and we are the cheapest solution on the market. Stape is affordable because we buy servers in bulk and for an extended period. Plus, we optimize our servers to work only with Google Tag Manager. 

Besides that, we have other advantages: 

1. Custom gtm.js and gtag.js loader. It helps you make Google Tag Manager and/or Analytics 4 scripts more resistant to adblockers. 

2. Global CDN. Allows for faster js files serving by using a server that resides closer to your site visitor. It results in an improved page speed that might positively affect organic ranking.  

3. Logs. A handy feature when setting up or troubleshooting server-side tagging. It helps to figure out what data was sent to the server and how it got processed. For example, you can check if all purchase events had 200 status (meaning they were correctly handled) or check all requests with a 500 response code. 

4. Preview header. It helps see all of your incoming requests in the sGTM debugger when the request was sent not from web GTM.

You can read about all of them in this blog post

Our team of experts is always happy to help new users get started with tracking and answer any questions.

For high-volume websites, we offer custom plans. Feel free to use the pricing calculator to estimate the best plan for your site. 

5. How to start with server-side trackingCopy link to this section

If you’re new and are lost between all the configurations - below, you can find the essential list of how you can start with server-side tagging.

Set up server Google Tag Manager containerCopy link to this section

The first step when starting with server-side tagging is to configure the sGTM container. Using Stape, you can set up a tagging server for your sGTM container in one click. All you need to do is:

2. Create a new container.

3. Add container name and select Server as a Target platform, click create.

4. Select Manually provision tagging server.

5. Copy Container Config.

6. Log in to your account

7. Click Create Container.

8. Add a container name, paste the container config you’ve copied from Google Tag Manager, and select server location. We recommend selecting a server location closer to your website visitors. 

add a container at stape

9. This step is optional but highly recommended. You can set a custom domain for your tagging server and enable CDN. Custom domain helps to set 1st party cookies, while Global CDN servers js files from servers closer to your user location. Please check your country tracking policies before enabling Global CDN. 

10. Once you've enabled these two (or one of them), you need to update DNS settings. You will find DNS settings for your container in the Stape account. 

11. Click create. It might take around 10 minutes to deploy the container. Once container status is running, you can proceed with the server-side tagging setup. 

12. Open you server Google Tag Manager container settings and add Server container URLs. If you’ve set up a custom domain, use it when configuring the Server container URL. If you did not configure the custom domain on step 9, you can copy the Tagging Server URL from the we created for you. 

add tagging server URL

 13. If you set up a custom domain on step 9, updating the GTM script on your site is highly recommended. Use your custom domain to replace tag 

Server Google Analytics 4Copy link to this section

Setting up server Google Analytics 4 is similar to UA setup : 

 1. Open web GTM container, enable checkbox Send to server container and add Server Container URL. 

2. Go to your Google Tag Manager Server container. Click Clients and add Google Analytics 4 client.

3. Create GA4 tags inside the server container. Go to tags -> click add New -> choose GA4.

4.  Create triggers for the tags you’ve created in the previous step. For GA4 trigger should be client name equals GA4.

 5. Open debug mode of the Google Tag Manager server container and verify that GA4 works from the server. Note that the server debugger takes longer than the web to update. To double-check the setup, open the console and check Google analytics requests. Once everything is set up, don’t forget to publish changes.

Server Google AdsCopy link to this section

If you want to have enough data to examine the performance of your ad campaign and provide Google's machine learning algorithms with additional knowledge about your company's objectives, Google Ads conversion tracking is a need. Moving Adwords tags onto a server will reduce the amount of code that needs to run on the webpages and aid with performance issues for slower internet connections as well!

Server-side Google Ads tracking can work only using server GA4 requests. It means that you must set up server-side Google Analytics 4 before proceeding to server-server Google Ads. 

Please take a look at how to set up server Google Ads: 

1. Ensure that server-side Google Analytics 4 is set up correctly.

2. In the Server container, set up the Conversion Linker tag. This tag should trigger on all pageviews. 

3. Set up Google Ads remarketing tag in server GTM. It looks similar to setting up a web remarketing tag. All you need to do is add a Conversion ID and choose a trigger that must use GA4 requests. You might also decide to send dynamic remarketing event data and Provide custom parameters. 

4. Create a new Google Ads Conversion Tracking tag in the Server container -> add Conversion ID and Conversion Label similarly to the web Adwords tag setup. Then you have an option to add Product and User Data. (it looks very similar to how Facebook conversion API works). If you send user and product data from the web to the server, you can enable these checkboxes and select event data as a data source. My Adwords server conversion triggers on the purchase event. 

Facebook conversion APICopy link to this section

Unlikely Google platforms, Facebook recommends using both web and server tracking. The main advantage of the web+server method is that it still utilizes 3rd party cookies (when possible). The main benefit of the server only approach is that it reduces the number of 3rd party java scripts on your site and allows you to strictly control what data was sent to FB. So it’s up to you to decide whether to use web+server FB tracking or server only. 

Setting up FB CAPI is more complicated since it requires event deduplication (when using the web+server method), sending user parameters, such as email, phone number, first/last name, etc. 

You can visit our blog post on how to set up Facebook conversion API or watch our video on Facebook conversion API using Google Analytics 4.

Other platformsCopy link to this section

I hope that by this time, you can agree with us that server-side tracking is a must for your marketing campaign. But it’s still relatively new technology, and not all platforms have provided it, e.g., Twitter. So we created a list of all vendors that support server GTM and consolidated their requirements, instructions, and documentation.

The most popular platforms for server-side tracking that our clients use are:

6. Advanced server-side trackingCopy link to this section

Besides the direct implementation of server-side tracking described earlier in this blog post, ss tracking gives some advanced opportunities previously unavailable in web tracking. Here I will cover some of the most popular ones. 

1. Connect CRM to sGTMCopy link to this section

It’s possible to serve webhooks from the CRM to sGTM. Inside the sGTM, you can retrieve webhooks data and add it to any platform. You may use it, for example, to enrich Facebook Conversion API Data with the user parameter or offline events.  Or maybe send in-store orders from your POS to Google Analytics or track refunds. 

2. Enrich data using FirestoreCopy link to this section

Firestore is a database that stores collections of documents. sGTM allows you to read and write data to/from Firestore. sGTM and Firestore give unlimited opportunities in terms of data enrichment. We have a detailed guide on how to read/write data to Firestore. 

3. Google Sheet integrationCopy link to this section

Stape created a custom tag that allows the integration of sGTM and Google Sheets. It’s an excellent opportunity for those who use tools similar to Zapier to track any data from the site into Google sheets. Tools like Zapier can be costly, while with sGTM, you can get the same integration at close to 0 prices. Check this article about the Google Sheet tag for sGTM. 

While there are many non-standard sGTM implementations,  these are the top three that stand out as being particularly popular. Check our blog for more information about ss tagging. 

7. Server-side tracking case studiesCopy link to this section

The most common case studies of server-side tagging show that it can significantly impact your data. It's important to note, though, how you implement this technology and what kind of solution you choose. The poor integration could potentially make things even more unstable than before.

Server-side tracking is a complicated topic since it relies on new technology, so be sure that the person who implements it does every hint correctly. 

If you need help setting up ss tracking, Stape can get it done! All that’s required is a few quick questions, and we will get back to you within the next business day.

Use of a Stape Custom LoaderCopy link to this section

A custom loader is one of the most remarkable and most popular features Stape offers to our clients. With the help of a custom loader, you can make tracking resistant to Ad Blockers. 

It's been said that about one-in-four internet users now use an ad blocker, so you can probably safely assume you are losing data about around 20% of your users.

Let’s say you’ve set up a custom loader power up and use server-side GA4 to set up FB CAPI. Stape Custom Loader power-up makes gtag.js and gtm.js invisible to ad blockers. A user with an enabled adblocker lands on your site; in this case, not only GTM and GA4 will have records about this user, but FB will also track data. 

With server-side tracking and an enabled custom loader, you can track up to 30% more data about website visitors.

Facebook conversion APICopy link to this section

Facebook encourages advertisers to implement CAPI because it should help to decrease the cost per acquisition and improve measurement.  

The impact of Facebook conversion API on campaign results excessively depends on how accurate and precise your implementation is. Facebook says that to get maximum results, you should use these best practices: 

  • use FB pixel and FB CAPI simultaneously
  • implement event deduplication
  • send user parameters together with FB CAPI events
  • share events in a realtime
  • improve event match quality score

It means that FB will have quality data for custom and lookalike audiences. It will also make conversion attribution in the FB ads manager more accurate. When all these best practices are implemented, our clients can see up to 98% of the conversion in the FB events manager. 

KlaviyoCopy link to this section

Klaviyo server-side integration gives the same possibilities as a standard Klaviyo implementation, but the main benefit is that ss Klaviyo does not slow down your site. 

For some of our clients, removing Klaviyo javascript from the site improved their page speed score by 7 points. 

Improved pagespeedCopy link to this section

The ideal schema for implementing server-side tracking is to have one primary data source for the sGTM and use it to set up ss tracking for all your platforms. 

In this scenario, you can remove all unnecessary 3rd party tracking scripts from your site. We have an article with a case study about how server-side tracking affects page speed

ConclusionCopy link to this section

Setting up server-side tracking is a great way to improve your website’s performance and get more accurate data. It can be a little daunting to set up at first, but with the help of this guide, you should be able to get started without any trouble.

This blog post gathered general information needed to get started with server-side tracking. Here we covered all of the possible guides and use cases. Don’t hesitate to write to us at to get assistance. We understand your needs and can help you to dive into the world of tags.

Switching to server-side?

Click Try for free and check all the solutions and benefits of Stape at no cost!

Try for free
Tagged with:gtm server

Relevant posts

Updated May 15, 2024

How to Set Up Facebook Conversion API + Events Deduplication & Hash User Data

Facebook Pixel allows you to track what users are doing on your site, collect remarketing audiences and create lookalikes. If the Facebook pixel is implemented correctly, it will feed relevant information to FB machine learning algorithms. FB ML will use pixel data to show your ads to people who are most likely to convert. For several years now, we could track events on the site via javascript code, Facebook SDK inside apps, or upload offline events. But how can you track users who installed Ad Blocker or track events outside the site? Or how can you extend a cookie lifetime? It can be done by implementing Facebook conversion API. This article will show you how to set up Facebook conversion API via Google Tag Manager Server Container.

Updated May 14, 2024

How to add a custom domain to the Google Tag Manager Server container

In this article, I will describe how to set up a custom subdomain within your Google Tag Manager server container. The main advantage of a custom subdomain inside the Google Tag Manager Server container is that it helps to bypass Intelligent Tracking Preventions, AdBlockers and increases cookie lifetime for users browsing in Safari. Pixels will be loaded from your subdomain and run as the first-party.

Updated May 14, 2024

How to set up Google Tag Manager Server Container

Collecting data about your website visitors is critical for analyzing and improving the online business presence, reaching users, and converting them into customers. However, collecting data is becoming more problematic because of Intelligent Tracking Prevention, AdBlockers, and a decrease in cookie lifetime. Google Analytics and other similar tools will start seeing fewer data about your website visitors and giving you less information to analyze.

Host your GTM server at Stape