Stape Integration
Stape is a server-side container hosting solution that simplifies deploying and managing sGTM containers. It provides a user-friendly interface with features designed to enhance performance and security.
Integration Levels
Stape offers multiple integration levels. This guide covers the most practical and efficient method: Stape CDN.
Advanced configurations, such as using your Own CDN or Same Origin setups, are excluded here as they require provider-specific worker configurations and custom infrastructure beyond the scope of this guide.
Create a Stape Account
If you do not have an account, create a Stape account here. Once registered, follow these steps to set up your server-side container.
Create a Stape sGTM Container
- In your Stape dashboard, click sGTM.
-
Click Create sGTM container.

-
Enter a Container name (this does not need to match your GTM container name).
- Paste the Container Config string copied from GTM.
- Select the server location closest to your target audience.
-
Click Create Container.

-
Choose a Stape plan (a free tier is available to start).
-
Click Continue.

Setup Custom Domain
- Click Add custom domain.
- Enter your Domain name (e.g.,
xyz.yourdomain.com). - Enable Add CDN to improve loading times.
- Select Stape CDN.
- Select Manually to retrieve DNS instructions.
- Click Next.

!!! tip "Privacy & Ad-Blocking"
- To bypass advanced ad blockers that target common subdomains (like gtm, stape, or taggrs), use a unique, less predictable subdomain.
- This Domain name is the value required in the module configuration under the GA4 tab > Server Container URL field.
- Create the CNAME or A records in your domain's DNS settings as provided by Stape.
- Click Verify in Stape to confirm the DNS records are correctly deployed.

!!! Info The verification process may take a few minutes to several hours, depending on your DNS provider's TTL settings.
Configure Stape Power-Ups
Custom Loader
The Custom Loader is a Stape feature that allows you to load the GTM container more efficiently, improving performance and reducing the impact of ad blockers.
- In your Stape dashboard, click sGTM and select your GTM container.
- Click the Power-Ups tab.
- In the Custom Loader panel, click Use.

- Enable the feature.
- Click Save Changes.

- Select your domain (previously configured).
- Enter your Web GTM ID.
- Enable GA4 ad block bypass.
-
Same Origin Path: Leave this field empty.
Advanced Configuration
Configuring a "Same Origin Path" requires additional server-side setups (such as proxies or workers) specific to each hosting provider. These steps are beyond the scope of this guide. To ensure a smooth integration, leave this field empty.
-
Select the Platform Other.
- Set the Data Layer Variable Name (leave it empty to use the default value).
- Select Generate with CDN.
- Disable Use original GTM code.
- Click Generate.
-
Review the generated code and follow the instructions below.

No Template Code Deployment Required
Do not manually copy, paste, or deploy any tracking code blocks (neither Head nor Body scripts) into your PrestaShop website files or theme templates. The module automatically handles all necessary script injections. You only need to extract the specific parameters from the code and save them within the module settings.
Mapping Stape Data to the Module
Once the custom script is generated, you must copy specific parameters into the module configuration in PrestaShop.
Warning
The Stape code below is only an example. Do not use it; you must generate your own unique code within your Stape account.
<!-- Google Tag Manager -->
<script>
(function(w,d,s,l,i){
w[l]=w[l]||[];
w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});
var f=d.getElementsByTagName(s)[0],j=d.createElement(s);
j.async=true;
j.src="https://load.xyz.yourdomain.com/2rqhgioesoz.js?"+i;
f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','cnfl0o=aWQ9R1RNLVBLQjNIUTM%3D&apiKey=fbf0cf8');
</script>
<!-- End Google Tag Manager -->
GTM Configuration Steps
- Navigate to the Tag Manager tab in the module configuration.
- Script URL: Locate the
j.srcvalue in your Stape script. Copy the URL starting fromhttps://up to the.jsextension (excluding the?and parameters).- Example:
https://load.xyz.yourdomain.com/2rqhgioesoz.js
- Example:
- Query ID Parameter: Identify the first part of the final string in the script (before the
=sign).- Example:
cnfl0o
- Example:
-
Override Tracking ID: Copy the remaining string after the
=sign.- Example:
aWQ9R1RNLVBLQjNIUTM%3D&apiKey=fbf0cf8
Precise Copying
When copying these values, ensure no extra spaces are included at the beginning or end of the strings. Extra spaces can cause the script to fail or trigger 404 errors.
- Example:
-
Click Save to apply the configuration.
Server Container URL
The Server Container URL routes events to your server-side infrastructure and enables the Tag Assistant feature in GTM for debugging and testing.
Based on the example configuration (using a domain without a custom path), your URL is: https://xyz.yourdomain.com
You must configure this URL in two places to ensure data consistency:
- In the Module: Navigate to the Google Analytics 4 tab.
- Server Container URL: Enter
https://xyz.yourdomain.com.
- Server Container URL: Enter
- In Server Side GTM: Go to your Server Container > Admin > Container Settings.
- Server Container URLs: Add
https://xyz.yourdomain.com.
- Server Container URLs: Add
Important: No Trailing Slash
Ensure the URL does not end with a trailing slash (e.g., /). Both the PrestaShop module and GTM settings must use the exact same string for the integration to function correctly.
GEO Headers
The GEO Headers power-up sends the visitor's geographic location directly to your server-side container. This feature enhances data accuracy for localized tracking and marketing compliance without relying on third-party browser scripts.
- In your Stape dashboard, click sGTM
- Select your GTM container.
- Click the Power-Ups tab.
-
In the GEO Headers panel, click Use.

-
Enable the feature.
-
Click Save Changes.

Configure Headers in GTM Server Container
To use these headers, you must map them inside your GTM Server Container as variables.
- Open your GTM Server Container.
- Navigate to the Variables section.
- Locate the pre-configured variables of type Request Header listed in the table below.
- Edit each variable and set the Header Name field to match its corresponding value from the table.
- Save the changes.
- Click Submit in the top-right corner of the GTM dashboard, then click Publish to deploy the configuration changes to your live container.
| Variable Name | Header Name |
|---|---|
| HEADER - User / Address / Country Code | X-GEO-Country |
| HEADER - User / Address / State Code | X-GEO-Region |
| HEADER - User / Address / City | X-GEO-City |
| HEADER - User / Address / Postal Code | X-GEO-PostalCode |