Custom Domain Proxy
Convultra supports serving the tracking SDK and API requests from your own domain (e.g. track.yourdomain.com) using a Cloudflare Worker proxy. This enables first-party tracking and bypasses ad blockers that target third-party tracking domains.
Custom domains are optional. Default tracking via cdn.convultra.com (SDK) and api.convultra.com (API) works without any proxy setup. Use a custom domain if you need ad-blocker resilience or want all tracking requests to appear as first-party.
Benefits
| Benefit | Description |
|---|---|
| First-party tracking | The SDK script and all event requests originate from your own domain. Browsers treat these as first-party requests. |
| Ad-blocker bypass | Most ad blockers maintain blocklists of known tracking domains. Your custom domain is not on those lists. |
| No per-customer SSL | Cloudflare handles TLS termination automatically -- no need to provision or manage SSL certificates. |
| Zero cold start | Cloudflare Workers use V8 isolates, not containers. There is no cold-start latency. |
How it works
Visitor's Browser
│
▼
track.yourdomain.com (Cloudflare Worker)
│
├─ Forwards SDK requests → cdn.convultra.com
└─ Forwards API requests → api.convultra.com
│
▼
Response returned to browser- The customer configures a custom hostname (e.g.
track.yourdomain.com) via Cloudflare for SaaS or a DNS CNAME record. - All requests to
track.yourdomain.comhit the Cloudflare Worker. - The Worker forwards the request to the Convultra API Gateway, preserving the original request headers and adding the correct
Hostheader. - The response from Convultra is returned to the visitor's browser.
SDK URL with custom domain
Once configured, use your custom domain to load the SDK:
<script async src="https://track.yourdomain.com/v1/ultra.js" data-convultra-key="YOUR_API_KEY"></script>The SDK will automatically send all API requests to track.yourdomain.com instead of api.convultra.com.
Setup
Prerequisites
- A Cloudflare account (free tier is sufficient for most use cases)
- Wrangler CLI installed (
npm install -g wrangler) or access to the Cloudflare dashboard - A domain managed by Cloudflare (or the ability to add a CNAME record)
Create the Worker
# Create a new Worker project
wrangler init convultra-proxy
# Navigate to the project
cd convultra-proxyReplace the contents of src/index.js (or src/index.ts) with:
export default {
async fetch(request, env) {
const url = new URL(request.url)
url.hostname = env.TRACKING_API_URL || 'api.convultra.com'
const modifiedRequest = new Request(url.toString(), {
method: request.method,
headers: request.headers,
body: request.body,
redirect: 'follow'
})
modifiedRequest.headers.set('Host', url.hostname)
return fetch(modifiedRequest)
}
}Configure the environment variable
Set the TRACKING_API_URL environment variable to api.convultra.com:
Add to your wrangler.toml:
[vars]
TRACKING_API_URL = "api.convultra.com"Add a custom domain
Add a custom route or hostname so the Worker responds on your tracking subdomain:
Use Cloudflare for SaaS to add track.yourdomain.com as a custom hostname for the Worker. This handles SSL and routing automatically.
Deploy
wrangler deployUpdate your SDK snippet
Replace the CDN URL with your custom domain:
<script async src="https://track.yourdomain.com/v1/ultra.js" data-convultra-key="YOUR_API_KEY"></script>Cost
| Tier | Included requests | Additional cost |
|---|---|---|
| Free | 100,000 requests/day | -- |
| Paid (Workers Paid) | 10 million requests/month | ~$0.30 per additional million |
For most Convultra customers, the free tier is more than sufficient.
Cloudflare Workers have no cold start because they run on V8 isolates rather than containers. Every request is handled with consistent low latency.
Troubleshooting
- Worker returns 522 or 524 errors -- Verify that
TRACKING_API_URLis set correctly and thatapi.convultra.comis reachable. - SSL certificate errors -- Ensure the custom domain is properly configured in Cloudflare and that the SSL/TLS mode is set to Full or Full (Strict).
- SDK not loading -- Confirm the route or custom hostname is pointing to the correct Worker. Test by visiting
https://track.yourdomain.com/v1/ultra.jsdirectly in a browser.