Server-to-server is different from older ways of tracking because it allows you to collect data more accurately, follows privacy rules better, and doesn’t depend as much on third-party cookies and web scripts that web browsers can block.
The Google Tag Manager server container is the most common tool for integrating server-side tracking. There are two ways of integrating server-side tracking: web+server (the most popular one) and server-to-server.
This blog post delves into server-to-server tracking using Google Tag Manager's server container capabilities. We'll explore how it works, its benefits, and how you can implement it to gain deeper insights into your analytics while maintaining user privacy and data integrity.
Server-side tagging in Google Tag Manager (GTM) is an effective feature that allows you to collect data on your website without relying on client-side scripts. This method helps reduce the impact on page loading speed and provides more control over data collection. By implementing server-side tagging, you can ensure that your data collection processes are less affected by ad blockers and browser restrictions.
So, how does it work? In server-side tracking, there is an intermediary (typically the Google Tag Manager cloud server). Instead of the browser sending the request directly (like with client-side tracking), the request is routed to the cloud server first. The cloud server processes the request and then forwards it to the third-party system (e.g., Google Analytics).
This method is the most popular one. It is a hybrid method that requires configuring web and server GTM containers. Also, you will need hosting for the server - Google Cloud Platform or third-party providers such as Stape.
You would also need to set up a custom domain for more precise tracking. In the very end, configure the sending of data from the web to the server GTM container. The two most popular ways to deliver data from the web to server GTM are server-side GA4 or Data Tag/Data Client.
Server-to-server tracking is a data collection method that sends information directly from one server to another. Data collected in this way bypasses the client-side or user’s browser.
Implementing a server-side tagging setup in Google Tag Manager (GTM) can improve data accuracy and website performance by reducing the client load and minimizing third-party JavaScript execution in the user's browser. However, server-to-server tracking is more challenging to set up than web+server.
The fundamental difficulty of server-to server-tracking in sGTM lies in delivering and debugging data to server GTM. The most popular way to provide data to sGTM is through webhooks, which can be sent from CRM or CMS.
2. Add Container Name → Under Target platform, choose Server. Click Create.
3. Choose Manually provision tagging server. Copy your container config. We will need it in the following steps.
1. Go to stape.io and create an account or log in. You can try our service for free and explore the benefits of Stape hosting for the GTM server.
2. Press the button Create container.
3. Enter your container details:
4. Choose a plan for your container. You can start with a Free plan. Click Continue with a Free plan.
You will see the status of your container, container config, and plan name. It takes around five minutes to deploy a server container. Please reload the page to update the status. If the setup was done correctly, you should see the status “Running.”
Once your server container is ready, you configure tags to send data, triggers to determine when those tags should fire, and variables to store the dynamic information your tags and triggers rely on. For example, tags might send purchase data to Google Analytics, triggers would control when that happens, and variables could capture user session details from requests. This setup allows you to manage data collection with precision and flexibility.
Note:
By following these steps, you can successfully set up a server container in Google Tag Manager, enabling you to leverage the full benefits of server-side tagging.
This server-side setup will help you collect accurate data, improve website performance, and enhance user privacy, ensuring your analytics strategy is effective and compliant with modern standards.
Check the list of Stape’s GTM templates for both server and web GTM containers. |
Using webhooks from CRM to sGTM can provide valuable insights about offline sales. Configuring webhooks is easy in sGTM, thanks to the sGTM preview header powered by Stape.
Using webhooks from payment processors is another popular way of delivering data to sGTM. It can be beneficial if you want to track recurring orders, upsells, or refunds in sGTM.
With the help of Stape’s apps for CMS (Shopify, WordPress, Magento 2, BigCommerce, Wix, PrestaShop). We will show you how to set it up later in this blog post.
Stape’s SDK (iOS, Android, PHP, Node.js, and Flutter) allows sending events from apps to the Stape Data Client.
In this example, I will use the WordPress Stape plugin to send server data to sGTM. The debugging and retrieving data in sGTM will be identical for all ways of delivering data to sGTM. So, it does not matter how you send data. The steps of debugging and retrieving data will be the same for you.
3. Go to the Webhooks tab:
4. Open the server Google Tag Manager container and enable the preview.
5. Go to your Stape.io account and open the container to configure server events.
6. Add Data Client to sGTM container.
7. Configure Data Client in sGTM.
8. Open sGTM preview mode and test that the webhook was processed successfully. I’ve made a test purchase on the site, and in the sGTM debugger, I can see /order requests that the Data client claims. If you go to the Event Data in the sGTM debugger, you should see all the information from the webhook that the data client parsed.
9. Now, when you’ve successfully processed webhook data in sGTM, the setup is similar to any other setup in sGTM. You can use this data to transfer to whatever server tag you want.
Server-to-server tracking has unbeatable advantages over web+server tracking, such as better accuracy and higher security standards. However, in some cases, like Google Ads tracking, setting up pure s2s integration is impossible because the native server Google Ads requires using Google Analytics 4 requests, which works in a hybrid method. However, you can combine web+server and s2s tracking by implementing Google Ads offline conversions.
In this guide, I’ve outlined several ways of sending server data to sGTM and showed an example of configuring s2s tracking in sGTM with the help of the GTM server-side plugin by Stape. When setting up pure s2s tracking inside sGTM, the most tricky part is debugging and retrieving webhook data in sGTM. Using the HTTP Preview header and Stape’s Data Client is helpful.
As we move towards a more privacy-conscious world, the methods and tools we use for tracking and analytics must evolve. sGTM server-side tagging (GTM server container) is at the forefront of this evolution, providing businesses with the tools to make informed decisions based on comprehensive, reliable data.
Whether you're a marketer, web admin, or developer, the insights provided in this post should guide you in making an informed decision about integrating server-to-server tracking into your analytics strategy. Embracing this technology means staying ahead with your Google Analytics data quality, insightful, compliant, and future-proof.
Click Try for free and check all the solutions and benefits of Stape at no cost!
Comments