Last updated 26 November 2026. By Paul Badarau.
A fictional studio publishes a client site with this policy, and then wonders why the reports stay empty and why a thrown error never arrives.
default-src 'self'; script-src 'self'; connect-src 'self'
The analytics snippet is an external script. Copy it from the Project's tracking setup. It loads with defer from https://analytics.postdeploy.dev/script.js and posts each event to /api/event on that same host, first with sendBeacon and otherwise with fetch. Both of those need connect-src. The tag is not an inline script, so this snippet does not need unsafe-inline.
Error monitoring is separate. You bundle @sentry/browser into your own files and pass the Project's DSN to Sentry.init. Those files come from your site, so script-src does not need the monitoring host for that setup. The SDK posts envelopes to the DSN host, https://monitoring.postdeploy.dev, and that post needs connect-src.
Add the two hosts to the policy you already have.
- Add
https://analytics.postdeploy.devtoscript-srcand toconnect-src. - Add
https://monitoring.postdeploy.devtoconnect-src. - Keep
'self'in both lists if your own scripts and your own API stay on your site. - Deploy the policy, open the live site, and run the collection check in Analytics. Then throw a test error and open it in Monitoring.
A policy that allows only scripts you have hashed will still refuse the snippet, because the file is served from the analytics host and the tag you paste does not carry a hash. Allow the host.
Source maps are uploaded from your build with an upload token, not by the visitor's browser. The page policy does not send them and does not block them. A Project holds 200 source maps. A debug-ID map stored with different bytes is refused with status 409 and cannot be replaced. A release map with different bytes is replaced. No single map can be deleted.
The product page for this is Analytics.