Dokumentation durchsuchen
Boosters
Shopify apps
Same-Origin Setup
DNS Setup
Getting Started with sGTM Hosting
Same-Origin Setup
1 Min. LesezeitAktualisiert am 6. November 2026
Same-Origin Setup
Artikel in diesem Bereich
- Set up with Cloudflare Workers1. In Cloudflare, go to: Compute & AI > Workers & Pages and create a new Worker. 2. Configure the Worker code to intercept requests on the chosen path (/metrics/) and route them to the sGTM server. 3. Add a Route mapping your sGTM URL to your domain. 4. Configure Configuration Rules with SSL set […]
- Setup with Nginx
- Set up with VercelCreate a file at api/metrics.js that acts as a proxy. The serverless function intercepts requests, extracts the real IP from the x-forwarded-for, and routes the request to the sGTM container with the appropriate headers.
- Set up with Azure Front DoorFor sites using Azure Front Door as a CDN/reverse proxy, set up Same-Origin by creating a new origin and route in the Azure dashboard. Step 1. Create an origin Step 2. Create a route Step 3. Configure headers
- Set up with AWS CloudFrontFor sites using AWS CloudFront, set up Same-Origin by creating a new origin, behavior, and Lambda@Edge function. Step 1. Configure the origin Step 2. Configure the behavior Step 3. Deploy the Lambda@Edge function To verify, open https://yoursite.com.br/metrics in the browser. A 400 error indicates t
- Setup with Apache HTTP ServerFor Apache servers, configure mod_proxy as a reverse proxy for the sGTM container. Step 1. Enable the required modules Enable the three required modules by running: sudo a2enmod proxy, sudo a2enmod proxy_http, and sudo a2enmod ssl. Step 2. Configure the VirtualHost Add the following directives to yo
- Set up with Deno DeployFor sites hosted on Deno Deploy, create a serverless function that acts as a proxy for the sGTM container. Step 1. Create the proxy script Create a main.ts file with the following logic: set ORIGIN_PATH to the path you want (e.g., /metrics) and GTM_URL as the URL of your sGTM container. The Deno.ser
- Set up with NetlifyFor sites hosted on Netlify, use serverless functions to create the proxy. Step 1. Create the serverless function Create the netlify/functions/metrics-proxy.js file in your project. The function extracts the client IP from the x-nf-client-connection-ip header and routes the request to the sGTM conta
- Set up with CaddyFor Caddy servers, add the reverse proxy configuration to your Caddyfile. Caddyfile configuration Add the following block to your Caddyfile: Replace /metrics with the path you want and sst.yoursite.com.br with your sGTM container domain. Restart Caddy after applying the changes.
- How to testTrigger a pageview and confirm that the server container receives the requests. In DevBoosters, verify that requests to /metrics return status 200 and are treated as same-origin.
- How to integrate Same-Origin in Google Tag ManagerAfter configuring the proxy on the server (Cloudflare or Apache), you need to update the configuration in GTM: 1. Open Google Tag Manager and access the web container (client-side). 2. Edit your Google Analytics: GA4 Configuration tag (or the corresponding GA4 Event tag). 3. In the server_container_