Ad blockers & proxy
Serve DataBull from your own domain so ad blockers treat it like the rest of your site.
Blocklists target third-party analytics domains. When the script and events go through your own domain, they look like part of your site. If your site runs on Cloudflare Workers, add this to its Worker (the setup page fills in your URL and token):
const DATABULL = 'https://YOUR-DATABULL-URL';
const DATABULL_TOKEN = 'dcp_…'; // per website; store as a secret
async function databullProxy(request) {
const url = new URL(request.url);
if (url.pathname === '/js/script.js') {
return fetch(DATABULL + '/js/script.js', { cf: { cacheTtl: 3600, cacheEverything: true } });
}
if (url.pathname === '/api/events' && request.method === 'POST') {
const cf = request.cf || {};
const headers = new Headers(request.headers);
headers.delete('cookie'); // your cookies never leave your domain
headers.set('x-datacheap-proxy', DATABULL_TOKEN);
headers.set('x-dc-ip', request.headers.get('CF-Connecting-IP') || '');
headers.set('x-dc-ua', request.headers.get('User-Agent') || '');
headers.set('x-dc-geo', JSON.stringify({ country: cf.country, region: cf.region, city: cf.city,
continent: cf.continent, latitude: cf.latitude, longitude: cf.longitude, asn: cf.asn }));
return fetch(DATABULL + '/api/events', { method: 'POST', headers, body: request.body });
}
return null;
}
Then load the script from /js/script.js on your own domain. The token lets your Worker forward real visitor location and IP, and only works for that one website.