You might want to route your analytics traffic through your own domain. This will lead to fewer DNS lookups as well as prevent AdBlockers from blocking it.
✅ Your worker is now available under
You can already use
https://something.else.workers.dev/sb.js as a custom domain in your script.
After deploying the worker, you need to navigate to one domain of your choice managed by Cloudflare.
/*you want the worker to be available at. In this example we are using
feedback.fish. Our route would be:
Last, we need to link the subdomain to a random IP. Navigate to DNS and create a new A record
Done! The new worker is available under hive.feedback.fish (not yours)
To use your custom domain, just replace the Splitbee script tag with:
<script async src="https://something.else.workers.dev/sb.js"></script>
In our example, feedback.fish, it would work like this:
<script async src="https://hive.feedback.fish/sb.js"></script>
In the init from our @splitbee/web library, you can provide the URL to the proxied script.
You can confirm by checking the DevTools network tab that all traffic indeed flows through your domain.