How to set up tagging server URL for server GTM

Dec 26, 2023
Mar 2, 2022
Also available in

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. 

What is server-side tagging, and why is server Google Tag Manager the best way to implement it?

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:

  • Tags are activated by triggers and extract data from variables.
  • Before publishing a new container version, you can test the setup in Preview mode.
  • The template gallery is available.

But there are also brand new features:

  • Requests are handled by a new type of GTM entity: the client.
  • Instead of trigger events, processes are triggered by incoming HTTP requests.

What is tagging server URL?

To get started with server-side tagging using server Google Tag Manager, you need:

  1. Create a server container in Google Tag Manager.
  2. Set up a tagging server URL.

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. sGTM hosting has these benefits:

  1. One-click setup.
  2. 6 times cheaper then GCP.
  3. Custom gtm.js loader - helps to make tracking more resistant.
  4. Preview header - helps to debug requests sent from non-web GTM.
  5. Faster gtm.js/gtag.js/analytics.js loading time - increases website pagespeed.
  6. There is no need to run scripts if you want to upgrade to the production environment - a quicker setup.
  7. No additional configuration in the server GTM container.
  8. Autoscaling - if website traffic increases, servers will scale automatically.
  9. Access and billing - easily share access with your team members and clients.
  10. Logs - helps to debug the setup with the help of logs of incoming and outgoing requests, as well as responses from stape sGTM tags.
  11. API - automate integration with stape.
  12. Multiple server zones.

How to set up a tagging server URL using Stape

1. Open -> 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.

manually provision tagging server

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.

create container in stape

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 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.

set up tagging server urls

To add custom domain, scroll down to Domains ->  Add the domain name (it can be -> Click Add domain.

Once done, you should set A record that points to the IP that you see in the admin. The IP address depends on the server location. DNS settings should be similar to what you see on the screenshot. 

add DNS setting custom domain stape 

It might take up to 72 hours to verify the domain, but it will be confirmed in 3-4 hours in most cases. 

Once the domain is verified, you are all set with the tagging server and can move to the sGTM configuration.

6. Google highly recommends updating the WEB GTM code on your site. It would be best if you replaced with your domain. Make sure that you did not remove /gtm.js.

Updating web GTM code helps to load gtm.js from your domain. 

gtm code

7. Add tagging server URL to the Google Tag Manager Server container. Admin -> settings -> container settings. 

container settings

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.

Tagged with:gtm server

Host your GTM server at Staperight now!