GTM / GA4 Script Proxy
Proxy Google tracking scripts through your first-party domain to bypass ad blockers and Safari ITP.
SerpWise can proxy Google Tag Manager (GTM) and Google Analytics 4 (GA4) scripts through your own domain. Instead of loading scripts from googletagmanager.com or google-analytics.com, the gateway rewrites script URLs in your HTML to serve them from your first-party domain — making them invisible to ad blockers and immune to Safari ITP restrictions on third-party scripts.
How It Works
- The gateway scans outgoing HTML for known Google tracking script URLs
- Script
srcattributes are rewritten to route through your domain via the gateway - When the browser requests the rewritten URL, the gateway proxies the request to Google's servers
- The script is served to the browser as if it came from your own domain
Browser requests: yourdomain.com/_sp/gtm.js?id=GTM-XXXXX
Gateway proxies: googletagmanager.com/gtm.js?id=GTM-XXXXX
Browser sees: First-party script from yourdomain.comNo changes to your origin HTML are needed — the gateway handles the rewriting automatically.
Configuration
Configure script proxying from the Tracking > Settings tab in your domain settings.
Options
| Setting | Description |
|---|---|
| Path Prefix | The URL path prefix used for proxied scripts (default: /_sp/). |
| Proxy GTM | Enable proxying of Google Tag Manager scripts (gtm.js). |
| Proxy GA4 | Enable proxying of GA4 scripts (gtag/js). |
| Proxy g/collect | Enable proxying of GA4 data collection requests (g/collect). |
Each script type can be independently toggled on or off.
Benefits
- Ad blocker bypass — Scripts served from your own domain are not matched by ad blocker filter lists that target
googletagmanager.comandgoogle-analytics.com - Safari ITP resistance — First-party scripts are not subject to Safari's Intelligent Tracking Prevention restrictions on third-party JavaScript
- Zero client-side changes — No modifications to your GTM container, GA4 setup, or origin code required
- Works alongside server-side tracking — Script proxying complements server-side conversion tracking for maximum data capture
How It Complements Server-Side Tracking
Script proxying and server-side conversion tracking work together:
- Script proxying ensures your client-side GTM/GA4 tags load and execute correctly, even when ad blockers are present
- Server-side tracking fires conversion events directly from the gateway to ad platform APIs, completely independent of the browser
Running both gives you the most complete picture of user behavior and conversions.