Skip to content

Stape Integration

Stape is a server-side container hosting solution that simplifies the process of deploying and managing server-side containers. It provides a user-friendly interface and various features to enhance performance and security.

Create a Stape Account

If you do not have one, create a Stape account here. Once you have an account, follow the steps below to set up your server-side container.

Create a Stape Server Side Container

  1. In your Stape dashboard, click sGTM
  2. click on Create sGTM container

  1. Enter a container name (it doesn't have to match your GTM container name).
  2. Paste the Container Config you copied from GTM.
  3. Select a server location that's geographically close to your target audience.
  4. Click on Create Container.

  1. Choose a Stape plan (they offer a free tier to start).
  2. Click on Continue to proceed with the setup.

Setup Custom Domain

  1. Click Add custom domain.
  2. Enter a Domain name (e.g., metrics.yourdomain.com).
  3. Enable Add CDN to improve the loading times
  4. Select Stape CDN or use your Own CDN
  5. Select Manually to get DNS Instructions
  6. Click Next to set up the custom domain.

Info

  • To prevent detection by advanced ad blockers that often target subdomains like gtm, stape, taggrs, or similars, consider using different, less predictable subdomains for your integration.
  • The Domain name is the value to set up on module configuration GA4 tab, Server Container URL input field.

  1. Set up the CNAME or A records and add it to your domain DNS settings.
  2. Click Verify in Stape to confirm the DNS are correctly deployed.

Info

The Verification process may take a few minutes, depending on your DNS provider.

Server Container URL

The Server Container URL is crucial for sending events to your server-side container and enabling the Tag Assistant feature in GTM, which helps with debugging and testing your site.

Based on the previous configuration screenshot, the Server Container URL for this example is: https://metricstp.reactioncode.com

Set this URL in the module configuration GA4 tab, Server Container URL input field, and in the GTM Container Settings in the Server Container URLs input field.

Info

Make sure the URL does not end with a slash. Both the GA4 Module Configuration and GTM Container Settings must use the exact same Server Container URL.

Configure Stape Power-Ups

It is essential to set up at least the GEO Headers

Info

Custom Loader is not available for GTAG script deployments.

GEO Headers

GEO Headers

GEO Headers is a Stape feature that allows you to send the user's location to the server-side container, improving data accuracy and reducing the impact of ad blockers.

  1. In your Stape dashboard, click over sGTM and select your GTM container.
  2. Click on Power-Ups tab.
  3. On GEO Headers panel click on Use.

  1. Enable the feature.
  2. Click on Save Changes.