Source: https://usedataowl.com/docs/fix-csp-content-security-policy-blocking-script
Markdown source: https://usedataowl.com/docs/fix-csp-content-security-policy-blocking-script.md
Description: Exact script-src and connect-src Content-Security-Policy header directives required to allow the DataOwl tracker and ingestion endpoint.

# How to Whitelist Web Analytics in Your Content Security Policy (CSP)

If your site sends a `Content-Security-Policy` header, the browser blocks scripts and requests to hosts it doesn't list. The console shows "Refused to load the script" or "Refused to connect".

Add DataOwl to `script-src` and `connect-src`:

```http
Content-Security-Policy: script-src 'self' https://usedataowl.com; connect-src 'self' https://usedataowl.com
```

Behind a [proxy](/docs/proxy-guide), everything comes from your own domain, so `'self'` already covers it. Session replay loads `/js/recorder.js` from the same host as the script.
