Server-side tracking monitors users’ website activity and relies on cloud servers instead of the user's browser. It is trendy at the onset of the cookieless era. This blog post will explore server-side tagging, how it works, and its benefits and drawbacks compared to client-side tracking. So let’s get started!
Before getting into the details of server-side tracking, let’s take a moment to discuss what client-side tracking is. This way, it will be much easier to grasp the difference between the two.
What is client-side tracking?
Client-side tracking is the most popular way of connecting websites with tracking platforms. It utilizes the user’s browser (client) to send information to the tag managing system or analytics platform. One of the most popular tag management systems is Google Tag Manager. After your site is connected with Google Tag Manager, you can use it to send information to any platform, like Google Analytics, Facebook, TikTok, Mailchimp, etc.
To make client-side tracking work, add Google Tag Manager (or any other tag management system) code to your website and, ideally, create a data layer. After that, tags and triggers that send information about user activity to third-party tools are set up.
What is server-side tracking?
With server-side tracking, your website first sends data to the cloud server. Then the cloud server distributes data between third-party vendors and tracking platforms. The most popular server-side tracking platform is again Google Tag Manager. They released their server-side tagging type of tracking in 2020.
A cloud server works as a proxy between the information you send to a third-party tool and your site (or any other data source). To use server Google Tag Manager, you need to set up a cloud server that should (but not must) utilize the subdomain of your website. Then, use server GTM requests to send information further to the tracking platforms.
Here are the main benefits of server-side tagging:
With Stape, you can set up tagging server URLs in one click - it's super simple. Plus, it saves you money. Stape’s hosting is around five times cheaper than GCP. Besides its cost and simplicity, server-side tagging with Stape has multiple advantages, like a custom loader, global CDN, logs, anonymizer cookie-keeper, multi-domains, preview header, account sharing, autoscaling, API, server zones, and more.
Considering all the benefits server-side tracking has, it is no wonder it has numerous use cases. Let’s take a look at the most popular ones:
- Data security. Server-side tagging gives you fuller data control since data is processed and stored on your servers before it’s sent to third-party services.
- Privacy compliance. When you go with server-side tagging, you can ensure that only the necessary and compliant data is shared with third-party services.
- Improved page load times. By handling tracking and analytics on the server side, you can reduce the amount of JavaScript running in the user's browser, which results in faster page load times and improved user experience.
- Reduced client-side processing. Offloading data collection and processing to the server can reduce the load on the client side.
- Advanced data enrichment. Server-side tracking permits the integration of additional data sources, such as internal databases or third-party APIs.
- Complex data transformation. The server performs complex data transformations and calculations before sending the data to third-party services, ensuring cleaner and more accurate data.
- Refined attribution models. Extending cookie lifetimes and combining web and server-side data can achieve more accurate attribution models.
- Bypass ad blockers. Since the data is sent directly from your server, server-side tagging is less likely to be blocked by ad blockers.
- Integration with internal systems like ERP, CRM, and other business intelligence tools.
- Custom workflows and automation to trigger marketing campaigns or operational alerts.
- Offline data integration. You can integrate offline conversion data, such as in-store purchases or phone sales, with online data to create a complete view of the customer journey.
There are several tools you can use to set up server-side tagging. Our choice is the server Google Tag Manager container. The main advantages of using sGTM, in our opinion, are:
If you want to set up Google Tag Manager server-side tagging on your website, we have a step-by-step manual on how to do it with our service.
Using Stape, you can set up server GTM in less than one 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, Stape has many 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 ad blockers.
2. Global CDN. This allows for faster JS file serving by using a server that resides closer to your site visitor. This results in improved page speed, which might positively affect organic ranking.
3. Logs. Logs are a handy feature when setting up or troubleshooting server-side tagging. They help determine what data was sent to the server and how it was processed. For example, you can check if all purchase events had a 200 status (meaning they were correctly handled) or check all requests with a 500 response code.
4. Cookie keeper. Extend cookies when a person uses any browser with the latest version of ITP, which shortens cookies’ lifespans for responses from third-party IPs. You only need one thing to do: activate our power-up Cookie Keeper.
5. Anonimyzer. With this power-up, you can remove or anonymize user data from Google Analytics.
We have a separate blog post covering the benefits of Stape hosting for Google Tag Manager server.
The first step when starting with server-side tagging is configuring 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:
1. Open your WEB Google Tag Manager container https://tagmanager.google.com/.
Click Admin. Under the container column, click +
2. Type the container name, choose Server, and click Create.
3. Choose Manually provision tagging server, copy your container config and paste it in any text editor. We will need it for the next steps.
4. Go to stape.io and create an account or log in.
5. Click Create container on the top right.
6. Enter your container details:
7. Choose a plan for your container. You can start with a Free plan. Click Continue with a Free plan.
8. You will see the status of your container, container config, and plan name. It takes around 5 minutes to deploy a server container. Please reload the page to update the status. If the Google Tag Manager server-side setup was done correctly, you should see the status “Running”.
Recommended. Set up custom domain:
There are three ways to set up a custom domain:
We have a detailed blog post where we describe mapping a custom domain for the server Google Tag Manager container: using the same origin (Cloudflare and nginx).
But here, we will cover custom subdomain setup:
1. Open your sGTM container on Stape, scroll down to “Domains” and click Add custom domain.
2. Write a custom domain.
3. You will see DNS records that you should add.
The DNS record depends on the server location and CDN option you choose.
The DNS records you should configure vary depending on the server location and your selected CDN settings. You will see DNS records that you should add inside your stape.io container.
4. Log in to your DNS account and add records you see in your stape.io account. Below is an example of DNS setup for CloudFlare. Open the DNS setting of the required domain and click Add record.
Then, write the records you see in your stape.io account. Ensure that the proxy is turned off.
Usually, it takes 2-3 hours to verify the custom domain. For some DNS providers, verifying records might take up to 72 hours. We will email you once the custom domain is verified or any error is detected. If there is an error with the verification, please follow this instruction on how to verify custom domain verification.
5. Once the custom domain is verified, go back to the Google Tag Manager Server container → Choose your server container → Admin → container settings → paste tagging server URL.
6. If you use a custom domain, updating the Web GTM script on your website is highly recommended. This tweak will load gtm.js from your domain. To do so, replace the default domain googletagmanager.com with the custom domain you set up in the previous step.
And all is done!
From our point of view, configuring a custom domain with the same origin domain is the best option because it helps to prolong cookie lifetime in all browsers. However, this method is technically advanced and requires CDN or a load balancer. If you want to configure the same origin domain, follow this guide on our blog.
If you can't configure the same origin domain, we have solutions for prolonging cookie lifetime in Safari: Own CDN and Cookie Keeper.
By mastering server-side tracking, you can gain valuable insights into user behavior that can form the basis of your marketing strategies and improve your website's performance.
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.
Stape has lots of tags for server GTM! Click on Try for free to register and check them all.