How to migrate to Stape?
Updated Sep 16, 2026
Migrating your server-side tracking to Stape means switching your hosting provider to Stape for your server Google Tag Manager (sGTM) container. You can easily make the move by exporting your server container configuration, redirecting your tracking requests to Stape, and shutting down your previous tagging server. Follow this guide for a clean cutover with little or no downtime.
Step 1 | Export and import the configuration in GTM
- Go to the container you want to migrate, and click Admin tab → Export Container.

2. Choose the container’s version, and then click Export. You’ll get a .json file.

3. Create a new sGTM container in Google Tag Manager, copy the Container Config and save it for later.
Create an sGTM container
➡️ Note
Before setting up your server-side Google Tag Manager container, it’s important to have web GTM container configured, because:
- The web container collects events, parameters and user interactions on your website.
- And sends this data to your server-side container.
Please follow the official Google documentation.
1. Select your GTM account → Click Admin → Click + next to the Container name.

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.

4. Go to your new container, and click Admin tab → Import Container.

5. Click Choose container file and select the .json file you’ve downloaded. Choose the workspace and the import option.
6. Click Add to workspace. The configuration from the old container is now migrated.

Step 2 | Set up a new container in Stape
- Create a new sGTM container in the Stape account and paste the container configuration that you’ve saved previously.
Create a container in Stape
1. Go to stape.io and create an account or log in.

2. Click Create sGTM container on the main page.

3. Enter your container details.
- Container name - give your container a name (for convenience, we recommend using the same name you gave to the server container in GTM).
- Container configuration - paste the Container Config data that you copied from the Install Google Tag Manager pop-up. If you lost it, go to Google Tag Manager → click Admin → click Container settings → copy the string under Container Configuration.
- Server location - for best performance, choose the server location that’s closest to where most of your clients are. See the list of available server locations here. Also, you can opt for the Global multi-zone server location option if you have traffic from different regions. It will automatically route incoming requests to the nearest available zone based on the user’s IP address.
Then click Create Container.

4. Choose a plan for your container. You can start with a Free plan. Click Continue with a Free plan.

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

2. Add a new custom subdomain. Verify it, and add the DNS records in your hosting provider.
Add a new custom subdomain
Use a custom tagging server URL, also called a custom domain, to set first-party cookies. This URL should use the same root domain as your website. For example, if your website is `example.com`, your tagging server URL can be `ss.example.com`.
There are three ways to set up a custom domain:
- Same origin – tagging server shares the exact domain and path with your site. Read more on how to set up a custom domain with the same origin.
- Subdomain – tagging server runs on a subdomain of your root domain. In this article we will guide you through this setup.
- Default domain – no custom domain; uses the standard Stape-provided address.

Step 1. Add your custom domain
Сhoose your container on Stape, scroll down to the Domains (Tagging Server URLs) section, and click +Add new.

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

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:

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

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

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
CNAME record(s) setup
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.

2. Click Add record.

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.

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


Adding a custom subdomain with A and AAAA records
| Please note that A/AAAA records are incompatible with enabled CDN. |
A/AAAA records setup
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.

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.

3. Click Add record.

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:

As a result, you will get two DNS records:


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.

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.

Step 6. Add tagging server URL and update your website script
Go to your Google Tag Manager server container → Admin → Container Settings → change Tagging server URL to your subdomain.

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.

You’ll see your new custom domain in your sGTM container’s list of domains. If you’re on a paid subscription, you will also see the Tracking Score estimating the quality of your domain’s tracking setup.

Click on your domain to access its settings:

Click Score to get more information about the Tracking Score report. Tracking Score report gives you an overview of your tracking setup health. Be sure to click the View full report button to get the full information, or New scan to update the report. Learn more about what constitutes a full report in our guide.

3. Go back to Google Tag Manager and open the web container. Update every place that sends data to sGTM (for example Google tag’s server_container_url, other tags, and webhooks) to the new tagging URL.
Step 3 | Test and publish
- Test your setup in the Preview mode.
Test and preview sGTM configuration
Debugging and monitoring are essential for a successful server-side tracking implementation.
1. Open preview mode in web and server containers.
- Go to Google Tag Manager.
- Open your server GTM container → click Preview.
- In a different browser tab, open your web GTM container → click Preview → enter your website’s URL.
This will start the web debug session. Your website will open in a new window with the GTM debug panel active at the bottom.

2. Trigger a request from your website.
- Perform actions that trigger tags. By simply loading the page, you’ve triggered the page_view event. Other simple possible actions include reloading the page or clicking a button. Such events will show in your debugger.
- In web GTM Preview, click on the event. Under Tags Fired, find the tag you configured to send data to your server (e.g., Google Analytics 4 tag). If it fired, it means a request was successfully sent to your server container.

3. Check incoming requests in the server GTM Preview.
- Go back to the server GTM Preview tab you opened in the first step.
- If you see events coming from your website domain, the setup works and requests are successfully reaching your sGTM container hosted on Stape.
- Click on the incoming request. Check the Tags Fired tab to see that your server-side tags (like the GA4 tag) have activated.

- In the fired tag, check the Outgoing HTTP Requests tab to see the request that your server container successfully sent to Google Analytics.

If you see that outgoing request, it means that the event data has passed from your website, through your server container, and on to the final destination.
Additional tools useful for debugging
Beyond the debugger, several additional tools support debugging an sGTM setup – covering everything from request-level detail to overall site tracking health. Which one to use depends on the data source and what you're trying to verify.
- Stape GTM Helper – a free Chrome extension that makes GTM's preview mode easier to use, with no sign-up or paid plan required. It color-codes tags by platform so you can instantly spot which ones failed, cleans up messy JSON and URL data into readable tables, and shows whether a visitor gave tracking consent – all directly inside the preview screen.
- Stape logs – a feature that keeps a record of the requests your server container sends and receives, so you can review what data was sent and what came back. Click into any logged request to see its full details when something needs troubleshooting.
- Logger tag – a tag for server-side GTM that logs requests to your server container, including POST request bodies (not captured by default logs), helping you track down issues. It sends logs to Console, Stape Store, BigQuery, or elsewhere.
- sGTM Preview Header – a power-up that lets you see requests in the sGTM debugger even when they don't come from your web GTM container, like webhooks, APIs, or CRM events. Pair it with a Data Client to debug webhooks specifically.
- Monitoring – a feature that checks your server container's logs and sends you an email if something goes wrong – like a sudden drop in events, a spike in errors, or missing requests – so you can catch problems early.
- Website Tracking Checker – a free tool that scans your site to assess tracking health across analytics, advertising, cookies, and SEO. Provides a score along with actionable recommendations to improve data accuracy and overall tracking performance.
3. When the preview looks correct, publish the web and server containers.
4. Turn off the old tagging server so you don’t duplicate events.
Tip:
Was this article helpful?
Comments