Setting up a tagging server is the first step if you want to implement server-side tagging. Tagging server works as a proxy and communicates between the data source (website, CRM, etc.) and the analytics platform. In this blog post, I want to talk about what tagging server is and how to set up a tagging server URL for the server Google Tag Manager container.
Third-party cookies and javascripts have been used for years to track user interactions on your website, but with the rise of tracking restrictions and concerns about user privacy, these are no longer enough. To get around these problems, most platforms started to recommend switching to a server-side type of tracking.
With the help of ss tagging, you can set first-party cookies, make your website work faster by removing 3rd party javascripts, and keep user data secure.
Tagging server works as an intermediary between your data source (website, CRM, etc.) and tracking platforms. The data source firstly sends information about users and events to the tagging server, and then tagging server distributes information to the tracking platforms.
For now, the most popular and the easiest way to integrate server-side tagging is server Google Tag Manager container. You can connect web and server GTM containers and use web GTM as a data source for the sGTM.
When the tagging server URL for sGTM is located in the same domain hierarchy as the website sending the requests, it sets first-party cookies and loads scripts from your domain. It helps to reduce the impact of tracking restriction and increase cookie lifetime.
Server GTM tagging uses concepts familiar to web GTM:
But there are also brand new features:
To get started with server-side tagging using server Google Tag Manager, you need:
The first step is easy to do - you just need to open the Google Tag Manager and create a new container. While tagging server is a new thing for most web analytics.
Tagging server URL works as a proxy in-cloud environment. After tagging server receives requests it distributes them further to other platforms (like Facebook, Google Analytics, etc.).
Using stape, you can create a tagging server URL for your server Google Tag Manager container in one click. When you create a server GTM container on stape, we automatically set up a cloud server on Google Cloud.
stape.io sGTM hosting has these benefits:
1. Open tagmanager.google.com -> Admin -> Click + in the Container section -> Add container name -> Select Server in the Target platform.
2. Choose “Manually provision tagging server,” copy your container config and paste it in any text editor. We will need it for the next steps.
3. Open your stape account.
4. Click "Create Container" and add your Container Name, Container Configuration that you copied from your Google Tag Manager Server Container, and select server location. Click Create Container.
It can take up to 10 minutes to set up a tagging server for you. Once a container status is Running, it means that tagging server for sGTM was created successfully.
5. This step is highly recommended but not required.
Once the container is running, you will see the Tagging Server URL; this URL is located within the stape.io domain by default. We highly recommend setting up a custom domain located within your site domain. It will allow you to set first-party cookies and make tracking more resistant and secure.
We will cover custom subdomain setup:
1. Log in to your Stape account, choose a container, scroll down and click Add custom domain.
2. There are two ways of adding custom domain:
The easiest way to connect domains. Log in with your DNS provider details via Entri, and give us one-time permission to connect your domain.
After you add a custom domain to your container, you will see DNS records that should be created to verify the custom domain. The DNS record depends on the server location and CDN option you choose.
You must create one CNAME record if you do not use Global CDN.
You must create two CNAME records, if you use Global CDN.
Below there’s a step-by-step guidance on how to create records using Cloudflare.
1. Log in to your domain name service and create a new DNS record for the subdomain you want to use.
If you use Global CDN, set additional CNAME record
2. Once your custom domain is verified, you should see the status ready below the tagging server URL in the Stape admin. If there are any problems with verifying a custom domain, please follow this guide on troubleshooting a custom domain.
3. Go to your Google Tag Manager Server container -> Admin -> Container Settings -> Change Tagging server URL to your subdomain.
If you want to verify your custom subdomain using A and AAAA records, you can do so by clicking Advanced settings after adding the custom subdomain to the container and ticking the “Use A records instead of CNAME records” box.
1. Open your sGTM container on Stape, scroll down to “Domains” and click Add custom domain.
2. Write a custom domain. Click Advanced settings after adding the custom subdomain to the container and ticking the “Use A records instead of CNAME records” box.
3. The DNS records you should configure vary depending on the server location. 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, create 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.
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.
8. That's it! Tagging server URL for the sGTM is set up. Now you can proceed with setting up server-side tagging in sGTM. This list of platforms that can be moved to the server-side can help you to get started.
Stape’s hosting for Google Tag Manager is the easiest and most affordable option around. We offer many features that make your tagging experience simple straightforward - and let you get back to what really matters: having proper tracking.
All you have to do is to click Get help, fill-up the form, and we will send you a quote.