How to set up tagging server URL for server GTM

Ira Holubovska

Ira Holubovska

Author
Updated
May 11, 2026
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.  

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

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

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

Step 1. Add your custom domain

Сhoose your container on Stape, scroll down, and click Add custom domain.

How to add a custom domain in the Stape admin

Add Subdomain name - it can be any name that works for you, just be sure to avoid using phrases specific to advertising or tracking: ad, gtm, stgm, tracking, analytics, metrics, stape, gtag, etc.

Step 2. Add CDN

A Content Delivery Network (CDN) distributes your website's assets across a global network of servers to reduce latency and improve load times for users in different locations. It is useful if your audience is geographically distributed or if you want to improve cookie tracking and data accuracy.

By default, the CDN is disabled, which means JavaScript files (like gtm.js, gtag.js, and analytics.js) are served directly from the server location where your sGTM container is hosted. Effectively, it bypasses both Stape Global CDN and Own CDN options and gives you a direct, unproxied connection between your site and the sGTM container.

Important: please consider your country's privacy regulations before setting up a CDN.

To enable the CDN, click the Add CDN toggle and select one of the following options:

CDN toggle
  • Stape Global CDN - loads scripts from a server closest to your website visitor's location, which reduces latency and improves page load times for geographically distributed audiences. We will use the Stape Global CDN in our setup. This feature is free and available for all Stape sGTM containers.
  • Own CDN (incompatible with the Automatically (via Entri) connection option) - helps route sGTM custom domain and proxy sGTM traffic through the DNS provider of your website. In this case, the IP addresses of your website and the custom domain of the sGTM will match, and server-side cookies will be considered as first-party. As a result, it gives the ability to increase cookie duration.
Own CDN selected

Step 3. Select the "How to connect" method

 Next, in the How to connect section, there are two ways of connecting a custom domain to your container:

"How to connect" options
  • Automatically (via Entri)

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. That's it, you can proceed directly to Step 5 to verify your domain; no manual configuration is required.

Automatic connection via Entri
  • Manually

With this option, you have to add DNS records manually to your hosting provider to connect your subdomain to Stape.

Manual connection selected

After you add a custom subdomain 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 the CDN option you choose. In the next step, we show how to add DNS records.

Step 4. Add DNS records (for the manual connection method)

By default, subdomain verification is performed with CNAME records, but you can verify your subdomain with A and AAAA records if you need to (usually in cases when you need to avoid adding duplicated records).

We will cover both options below with a step-by-step guide on how to create records using Cloudflare. But you can use any other provider.

Adding a custom domain with a CNAME record

You must create one CNAME record if you do not use Stape Global CDN and two records if you use Stape Global CDN.

1. Log in to your domain name service and create a new DNS record for the subdomain you want to use. To do it, click three dots and choose Configure DNS next to your domain name on the account home page.

Configure DNS

2. Click Add record.

"Add record" button

3. Go back to your Stape account and input the record you see in the account. Make sure that the Proxy status is turned off.

CNAME records in the Stape admin

We use Stape Global CDN, so we create two CNAME records:

CNAME record
Additional CNAME record (for the Stape Global CDN option)
Adding a custom subdomain with A and AAAA records
Please note that A/AAAA records are incompatible with enabled CDN.

1. If you need to verify your custom subdomain using A and AAAA records, add the custom subdomain to the container and make sure that the CDN toggle is switched off.

Click Advanced settings and tick the Use A records instead of CNAME records box. You will see DNS records that you should add inside your Stape container. The DNS records you should configure vary depending on the server location.

"Use A records instead of CNAME records" checkbox

2. Log in to your DNS account and add the records you see in your Stape account. On the account home page, next to your domain name, click three dots and choose Configure DNS.

Configure DNS

3. Click Add record.

"Add record" button

 4. Then, create the records you see in your Stape account. Make sure that the Proxy status is turned off.

Take the values for your DNS records from the Stape account:

A/AAAA records in the Stape admin

As a result, you will get two DNS records:

A record
AAAA record

Step 5. Verify your domain

Once you've entered the DNS records to your DNS provider, return to the Stape container page where you've been configuring the custom domain and click Verify.

"Verify" button

Wait for Stape to finish verifying your custom domain (when the container status bar changes from Verifying to Ready). 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 you face any problems with domain verification, please follow our guide on troubleshooting a custom domain.

Status "Ready" in the Stape admin

Step 6. Add tagging server URL and update your website script

Go to your Google Tag Manager server containerAdminContainer Settings → change Tagging server URL to your subdomain.

Server container URL in GTM

Update the script

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.

Alternatively, you can automate this process with the Custom Loader power-up. Instead of manually editing the GTM script, Custom Loader generates a ready-to-use code snippet that loads GTM and GA4 scripts directly from your custom domain. This saves your time, makes your tracking scripts more resilient to ad blockers, and assures all cookies are treated as first-party.

Custom Loader power-up interface

That's it! The 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. 

Conclusion

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.

Need help with setting up server-side tagging?

All you have to do is to click Get help, fill-up the form, and we will send you a quote.

Get help
author

Ira Holubovska

Author

Ira has 10+ years of digital marketing experience, with the last 5 focused on server-side tracking. She understands how and when it works across various digital marketing scenarios.

Comments

Try Stape for all things server-side