Setting Up A Server-Side GTM Container Using Stape.io (RAIN's Preferred Method) 2026

Setting Up A Server-Side GTM Container Using Stape.io

RAIN's Preferred Method

Last Updated: 2/26/2026

You should know: RAIN can complete the majority of this work for you. The only parts that must be completed on your side are (1) setting up your Stape account with billing info, and (2) setting up a new subdomain by adding DNS records in your domain management account.

How Long Will This Take?

As long as you have all the accesses you need, we can complete all phases of the setup in one session.

  • Part 1: 5 min to set up a new GTM Container

  • Part 2: 10 min to set up your Stape account and create a Stape sGTM Container

  • Part 3: 10 min to add and configure a custom domain in Stape

  • Part 4: 10 min to create your subdomain via DNS records, and verify this in Stape

  • Part 5: 5 min to configure and share your GTM Container with RAIN

Total: ~40 minutes.

Note: DNS records take only a few minutes to create, but verification typically completes within 30 minutes to 2 hours. In some cases, it can take up to 72 hours.

Accesses Needed

  1. A Google account with admin access in order to set up a server-side GTM container. This should be the same account used to manage your existing (browser-side) GTM container, your GA4 account, etc.

  2. Access to the account that manages your domain name (often called a domain registrar or DNS hosting service). This is where you purchased your domain name. It is typically not the same account through which you edit your website's content (e.g. WordPress).

  3. A company credit card to set up your Stape billing account. Note: Stape offers a free plan (10,000 requests) with no credit card required to start. A paid plan will be needed once traffic exceeds the free tier.


Part 1: Create a New Server Container in Google Tag Manager

You should already have a standard ("Web") GTM container in use. We need to create a new "Server" container within the same GTM account. Here's how:

  1. In a new browser tab, open tagmanager.google.com, making sure you are logged into the correct Google account for your organization. You should see your existing browser-side GTM account on this page.

  2. Click Admin. Under the Container column, click the + button to create a new container.

image-20260227-030609.png

a. Container Name: We suggest using the URL of your website (e.g. yourcompanydomain.com).

b. Target Platform: Select Server.

c. Click Create.

2 add new acct gtm.png
  1. On the Install Google Tag Manager pop-up, select Manually provision tagging server. Copy the provided Container Config code and paste it into a text editor for safekeeping.

3 install gtm.png
  1. Leave this tab open. We will return to it later.


Part 2: Create a Server Container on Stape.io

Stape reference: Stape has its own documentation at How to Create a Server Container in Stape. We have also included our own steps below.

Set up your Stape account and container:

  1. In a new browser tab, go to stape.io/sign-up to create a new Stape account. We recommend using the same email that has admin access to your GTM.

  2. Select "Global" (not EU) for your hosting region, and make sure to check the Terms of Service box.

  3. Once you have received the welcome email and set your password, you should arrive at your Dashboard.

  4. Click the Create container button.

4 create container button stipe.png

a. Container name: We recommend using your company's domain name (the same name used for your new GTM container in Part 1).

b. Container configuration: Go back to the Tag Manager tab you left open. Copy the Container Config code and paste it here. If you lost it, go to tagmanager.google.com → Admin → Container Settings → copy the string under Container Configuration.

c. Server location: Select the server location closest to where most of your website visitors are located. Note: location cannot be changed later. If you have traffic from multiple regions, consider the Global multi-zone option (available on paid plans).

d. Click Create Container.

5 create_container_stipe_2026.png
  1. Select a plan. You can start with the Free plan (10,000 requests/month). No credit card is required for the Free plan. If your site's traffic exceeds the free tier, you can enable automatic upgrades or select a paid plan. Use Stape's pricing calculator at stape.io/price-server-google-tag-manager to estimate your cost. You will need to know how many GA4 events your site generates each month.

  2. Set up your billing account. Select your country and state, fill in your billing information, and save.

  3. Verify your container is running. You will be routed back to your Dashboard. It takes approximately 5 minutes to deploy a server container. Reload the page to update the status. If the setup was done correctly, you should see the status "Running." If you see "Error," verify that you copied and pasted the correct Container Config. If the error persists, contact Stape's support team.

image-20260227-023349.png

Part 3: Add and Configure a Custom Domain in Stape

Important: In order to get the primary benefit of server-side tagging (first-party cookie support and improved data quality), it is essential to set up a custom subdomain using your existing domain rather than the default Stape subdomain. The default Stape subdomain should only be used for initial testing.

Add a custom domain:

  1. In your Stape account, select your container, scroll down to the Domains (Tagging Server URLs) section, and click Add custom domain.

8 manually add cust domain.png
  1. Choose how to connect your domain. You have two options:

    a. Automatically (via Entri): The easiest option. Log in with your DNS provider details through Entri and give one-time permission to connect your domain. Check the list of supported DNS providers.

    b. Manually: You will be shown DNS records to add to your DNS provider. This is covered in Part 4 below.

image-20260227-023649.png
  1. Enter your Domain name. Fill in the full domain name including your chosen subdomain. A subdomain is the part before your main domain (for example, gtmss.yourdomain.com). You can use any subdomain name you want, such as "gtmss" or "sst." We recommend using an unobvious subdomain name that does not directly reference GTM, Stape, analytics, or tracking.

  2. CDN options (optional): Toggle "Add CDN" if desired. Options include:

    • Stape Global CDN: Loads JS files (gtm.js, gtag.js) from a server closer to your visitors for faster page loads.

    • Own CDN: Routes sGTM traffic through your website's DNS provider so the IP addresses match, making server-side cookies fully first-party (important for Safari/Firefox ITP). Requires Cloudflare or similar. Not compatible with the Entri auto-setup option.

    • Disabled CDN: No CDN is used. A single CNAME record will be required.

image-20260227-023949.png
CDN toggle area showing Stape Global CDN and Own CDN options.
  1. If you selected the Manual setup option, select whether to use CNAME records (default) or A/AAAA records (available under Advanced Settings). Then click Next. Stape will display the DNS records you need to add to your domain provider.

image-20260227-024231.png
  1. Leave this Stape tab open and move on to Part 4.


Part 4: Create DNS Records and Verify Your Custom Domain

Caution: DNS settings dictate core functionalities of your website. Done correctly, there should be no impact on your website other than adding server-side GTM tagging capabilities. However, many of our clients prefer that we do this part together with a member of their IT team who is knowledgeable and comfortable with DNS settings management.

  1. In a new tab, log into your domain name registrar or DNS hosting service. Keep your Stape tab open as you will be referencing information there.

  2. Navigate to your website domain's DNS management or control panel section. This might be under Products / Domains, DNS Settings, Name Server Management, or something similar.

    In the GoDaddy platform, the clicks from the Home section are: All Products → Domains → (Find the correct domain) → "..." Menu → "Edit DNS"

  3. Back up your current DNS records before making any changes. This protects you in case of any errors.

  4. Find the option to Add a DNS record and fill out the information using the values shown in Stape. Copy/paste as much as possible to ensure accuracy, and remove any errant spaces or extra characters.

image-20260227-024430.png
a7ef29a6-c81a-4801-be16-5458b0ec5b55-20260227-024659.png
Adding a new record in GoDaddy’s Platform

a. Type: Select "CNAME" from the dropdown (or A/AAAA if you chose that option in Stape).

b. Name (or Host): Important: Unless your DNS platform specifically asks for the full URL, only enter the subdomain portion you see bolded in Stape (e.g. "gtmss").

c. Value (or Points To / Target): Enter exactly as shown in Stape.

d. TTL: Leave at default setting (e.g. 1/2 Hour) or select Auto.

e. Proxy Status: Disable (toggle OFF). If you do not see a Proxy Status field, it is disabled by default.

Note: If Stape provided multiple DNS records (e.g. when using Global CDN), repeat this process for each record.

image-20260227-024539.png
  1. Click Save to finalize the records.

  2. Review and Confirm: It is always good practice to review the newly entered DNS records to ensure they match the information in Stape exactly.

  3. Back in your open Stape tab, click Verify. Verification typically takes 30 minutes to 2 hours. In some cases, it can take up to 72 hours. Stape will send you an email once the custom domain is verified.

image-20240517-181506.png
7e02cb9c-b87c-4dcf-a134-0dacb6674578 (1).png
Stape Domain Status showing “Ready”
  1. Once the domain is verified and shows "Ready" in Stape: Go to your Google Tag Manager Server container → click Admin → click Container Settings → click Add URL, and enter the same custom domain you just configured.

    a. Include "https://" at the beginning, and ensure there is no "/" at the end.

    b. Click Save at the top-right of the screen.

12 GTM container settings save.png

Recommended: If you use a custom domain, updating the Web GTM script on your website to load gtm.js from your custom domain (instead of the default googletagmanager.com) is highly recommended. This improves tracking resilience against ad blockers. Your RAIN team can handle this step for you.


Part 5: Share Your GTM Container with RAIN

Finally, share your new Server Side GTM Container with RAIN so we can begin configuring tags.

  1. In your Server GTM Container, go to the Admin tab. On the right side (the "Container" section), click User Management.

9 gtm admin tab.png
13 gtm user mngmt add users.png
  1. Click the + icon on the top-right of the screen, then select Add Users.

  2. Enter support@rainlocal.com, check the box for Publish access (which will automatically select all checkboxes). Click Invite.

14 gtm send invite.png

You're done with Tag Manager! Please let us know when you've completed these steps so we can verify everything looks good on our end and continue the tag setup process.


Important Notes

  • Content Security Policy (CSP): If you have a CSP enabled, you must add the server endpoint (the new subdomain you created) as a trusted source in your CSP. This should be added to both connect-src and script-src directives. Otherwise, the browser will block those requests.

  • GTM in CSP: Include rules for GTM's client-side scripts in script-src and ensure that any dynamically loaded resources (e.g. analytics.js or gtag.js) are accounted for.

  • Inline Scripts: If your implementation requires inline scripts (e.g. custom JavaScript in GTM), use CSP with nonces or hashes to allow only trusted inline scripts to execute.

  • CAA Records: If your domain uses CAA (Certificate Authority Authorization) records, ensure you have added the appropriate CAs used by Stape:

    Depending on your CDN configuration. Refer to Stape's custom domain documentation for specific record values.

Please get in touch with our team if needed. It can take some time to determine what steps are needed, and some testing may be required. This is normal, and we are experienced with these configurations. We are happy to troubleshoot any specific cases with you.