What is File Proxy?
The File Proxy add-on lets you serve external JavaScript files (GA4 gtag.js, Meta Pixel, TikTok Pixel, etc.) directly from your domain. Ad-blockers and ITP won't block them because they're on a first-party URL.
Why use File Proxy?
- Bypass ad-blockers:
track.yourdomain.cz/ga4.jsisn't blocked. - First-party cookies: Scripts loaded from your domain = first-party cookies.
- ITP bypass: Safari doesn't block first-party requests.
- Compliance: Data doesn't pass through a 3rd-party CDN.
How to activate
- Go to Dashboard → Add-ons
- Turn on the "File Proxy" toggle
- Click "Add proxy"
- Enter:
Proxy record configuration
- External URL: The URL of the external file (e.g.
https://www.googletagmanager.com/gtag/js?id=G-XXXXXX) - Proxy Path: The local path on your domain (e.g.
/fp/ga4.js) - Cache Duration: How long to cache the file (3600s = 1h, 86400s = 24h)
Usage examples
1. GA4 gtag.js proxy
External URL: https://www.googletagmanager.com/gtag/js?id=G-XXXXXX
Proxy Path: /fp/ga4.js
Cache: 86400 (24h)
Usage on the site:
<script async src="https://track.yourdomain.cz/fp/ga4.js"></script>
2. Meta Pixel proxy
External URL: https://connect.facebook.net/en_US/fbevents.js
Proxy Path: /fp/fbpixel.js
Cache: 3600 (1h)
Usage on the site:
<script async src="https://track.yourdomain.cz/fp/fbpixel.js"></script>
3. TikTok Pixel proxy
External URL: https://analytics.tiktok.com/i18n/pixel/events.js?sdkid=XXXXXX
Proxy Path: /fp/tiktok.js
Cache: 3600 (1h)
How does it work?
- A request arrives at
https://track.yourdomain.cz/fp/ga4.js - The DataNostro nginx location
/fp/→ proxy_pass to the tracking/views.py FileProxyView - FileProxyView finds the matching proxy entry in the database
- Downloads the file from the External URL (if it's not in the cache)
- Saves it to the Redis cache (TTL = Cache Duration)
- Returns the file with headers:
Content-Type: application/javascript,Cache-Control: max-age=86400
Performance
- First request: 200-500ms (download from the External URL)
- Subsequent requests: 5-20ms (Redis cache hit)
- Cache hit rate: 95-99%
💡 Recommendation:
Use File Proxy in combination with the Custom Loader for maximum ad-blocker bypass. All tracking scripts (GTM + GA4 + Meta + TikTok) served from your domain = up to 40% more data.
Limitations
- Max file size: 5 MB
- Max number of proxy entries: 50
- Doesn't support dynamic query parameters (except
?id=XXX)