Content-Security-Policy
If your website sends a Content-Security-Policy header, it must allow the tracker’s origin, https://c.upbeatanalytics.eu, in two places:
| Directive | Why |
|---|---|
script-src |
to load s.js or s.auto.js |
connect-src |
to send page views and events to /e |
For example:
Content-Security-Policy: default-src 'self'; script-src 'self' https://c.upbeatanalytics.eu; connect-src 'self' https://c.upbeatanalytics.euAdd the origin to the directives you already have; don’t replace them.
The queue line
Section titled “The queue line”The queue line for early custom events is an inline script. If your policy doesn’t allow inline scripts, either:
-
allow it by its hash. The line is always the same, so its hash is too. Add this to
script-src:'sha256-GDQ8FeADBkUWvk8x4kR5sFFllQLu7N+d19+SEZW4axI='This holds only if you paste the line exactly as shown, with nothing added inside the
<script>tags, not even a line break; or -
put the line in a file of your own, loaded before the snippet; or
-
leave it out and call
window.upbeat?.(…)only after the page has loaded.
Checking
Section titled “Checking”Open your website with the browser’s developer tools on the Console tab. A blocked tracker shows a message about the Content-Security-Policy that names c.upbeatanalytics.eu. When it works, the Network tab shows a request to /e for each page view.