Skip to content
Dericson Calari
Back to the blog
Capa do artigo: How to set up Stape with GTM Server and own domain

How to set up Stape with GTM Server and own domain

Configure Stape with GTM Server, connect a subdomain by the DNS records of the dashboard and validate the path of the event, from the browser to the GA4, with Preview Web, Preview Server and DebugView.

Foto de Dericson Calari

Published on7 min read

To set up Stape with GTM Server and own domain, you need to connect four parts. The Web container sends the event, a Stape hosts the Server container, the domain points to that hosting, and the Server tags forward the data to the destination. Validation follows this path to the GA4. Data flow on Google.

Before I start

Get editing access to the GTM Web installed on the site, permission to create a Server container, account in the Stape, access to the domain DNS and a property GA4 of testing with Web flow and measurement ID. Separate a page to validate events without personal data.

The Web performs in the browser and collects interactions. The Server receives requests, processes events, and executes target tags. A Stape provides the infrastructure to host this second container. Creation of containers, hosting in the Stape.

In this synthetic example, the site is https://www.example.com and the collection uses https://dados.example.com. All values must be replaced by those of their implementation.

1. Create the Server container and connect to Stape

No GTM, create a container with platform Server. In the configuration of the hosting, choose Manually provision tagging server and copy the Container Config. This field contains a configuration string. Procedure of Stape no GTM.

Na Stape, open Create sGTM container, choice Manually, enter the name and paste the string into Container configuration, also in the manual mode. Choose the appropriate region and plan for the operation. Check the commercial conditions before confirming the subscription, because the paid contracting starts the charge. Wait for the hosting to stay Running. Create hosting in the Stape.

2. Connect the subdomain using the dashboard records

In the container of Stape, find Domains (Tagging Server URLs), click on + Add new, enter the subdomain and select the connection Manually. The dashboard generates DNS records depending on the region and the CDN option. Copy type, host and destination exactly as they appear. The values belong to that configuration. Add own domain.

The CDN choice defines the following steps.

  • Deactivated CDN, used in this example, maintains direct connection to hosting. The guide of this modality guides proxy off in the example with Cloudflare. Disabled CDN.
  • Stape Global CDN It has its own records. The guide also guides proxy off in the example with Cloudflare and distinguishes the address with load. for event address scripts. Stape Global CDN.
  • Own CDN Use the proxy of your infrastructure. In the official example with Cloudflare, it involves connected proxy, certificate, SSL rules, header and cache. Follow the full procedure of this modality. Own CDN.

With the records saved, return to the Stape, click on Verify and wait for the domain to reach Ready. Check out HTTPS and the certificate. In the example without CDN, go to https://dados.example.com/healthy and look for the answer OK. Then, in Admin → Container Settings of the GTM Server, report https://dados.example.com in Tagging server URL. Domain verification, Health test.

Subdomain and same-origin

The subdomain uses a host of its own, such as dados.example.com. Same-origin uses the same site origin with a dedicated path, such as https://www.example.com/coleta, forwarded by CDN or balancer. Each alternative requires its infrastructure configuration. Domain Options in Google.

Preserve the consent signals while shipping. Google describes how Google tag carries these choices and how tags on Server adjust their behavior. Consent in the server-side environment.

3. Direct the Google tag to Server

No GTM Web, create a variable Google tag: Configuration settings. Add the parameter server_container_url with the value https://dados.example.com.

Associate the variable with Google tag in Configuration settings and check out the measurement ID of the test property. Google’s current guidance uses the trigger Initialization – All Pages for initialization, observing the implementation of consent. Save to test in Preview. Send data to Server.

4. Configure the Client and the target tag

No GTM Server, open Clients and check out the Google Analytics: GA4, usually pre-installed. Keep the paths enabled GA4 to recognize the requests. The Client interprets the format received and creates the event data. Receive data on Server.

In Tags, create a Google Analytics: GA4. For this flow, the fields can inherit the measurement ID and the event parameters. Create a trigger Custom, with Some Events, filtering Client Name by the real name of the Client. If he's called GA4, use that value. The tag turns data into a request for Analytics. Client, tag and trigger configuration.

5. Test the event until the GA4

Open first the Preview of Server. In another tab, open the Web Preview and connect the test page. Charge it to generate one page_view. Preview of the two containers.

Follow the sequence of evidence.

  1. On the Web, check out the Google tag and, in the browser network panel, the request sent to your domain.
  2. On Server, find a Incoming HTTP Request. She proves the arrival at the accommodation.
  3. Check out the Client who claimed the request and the event generated.
  4. In Tags, examine the trigger of the tag GA4.
  5. Open Outgoing HTTP Requests, check out the submitted content and the destination HTTP response. Server Debugging.

Finally, on the test property of the GA4, open Administrator → Data display → DebugView and locate the page_view of the device in debugging. Check your parameters. The Assistant/Preview Tag allows you to debug the session. Check the signal debug_mode received and consent choices if the event is absent. This step confirms the visible reception in Analytics. Monitor events in DebugView.

Checklist and diagnosis

  • Pending domain calls for conference of generated records and the selected CDN mode.
  • HTTPS failure calls for revision of the certificate and proxy configuration of that modality.
  • Preview Empty Server calls for conference of server_container_url, network request and CSP policies.
  • Request received without event asks for review of the Client and the paths enabled.
  • Event present without way calls for review of the trigger, the tag and the errors.
  • Output present with empty DebugView asks for property conference, ID, debugging and consent. Receipt and CSP, debugger, DebugView.

Save the evidence of each step before preparing the publication of the Web and Server versions in your implementation.

To know the platform, see the blog guide. What is it Stape.

Checkouts and protection rules require specific validations. Conversion tracking on Shopify, Bots, Stape and Cloudflare.

If you are hiring the infrastructure, you can consult the hosting by my affiliate link. I can receive a commission if you hire it. View hosting of the GTM Server in the Stape.

Sources consulted in 15/11/2026

  • Stape, “Step 1. Create a server container in Google Tag Manager”, updated in 26/06/2026. Source.
  • Stape, “Step 2. Create a server container in Stape”, updated in 26/06/2026. Source.
  • Stape, “Step 3. Add a custom domain”, updated in 13/11/2026. Source.
  • Stape, “Disabled CDN”, updated in 10/05/2026. Source.
  • Stape, “Stape Global CDN”, updated in 07/08/2026. Source.
  • Stape, “Own CDN”, updated in 21/10/2026. Source.
  • Google, “Custom domain configuration”, updated in 27/06/2025. Source.
  • Google, “Send data to server-side Tag Manager”, updated in 06/11/2026. Source.
  • Google, “Configuring the Google Analytics data stream with server-side tagging,” updated in 30/07/2026. Source.
  • Stape, “Step 5. Test and preview sGTM configuration”, updated in 26/06/2026. Source.
  • Google, “Preview and debug server containers,” updated in 30/07/2026. Source.
  • Google, “Monitor events in DebugView,” with no explicit update date on the page you consulted. Source.
  • Google, “Implement consent mode with server-side Tag Manager”, updated in 30/07/2026. Source.