CSP sources for common third-party services
Vendors change their hosts, so each list links to its source. Add the values to the directives you already have: a directive can appear only once in a policy.
Google Tag Manager
Google recommends a nonce, set in the header and on the container snippet:
script-src-elem 'nonce-RANDOM'Without one, the container needs:
script-src-elem https://www.googletagmanager.com 'unsafe-inline';
img-src https://www.googletagmanager.com;
connect-src https://www.googletagmanager.com https://www.google.comCustom JavaScript variables also need 'unsafe-eval' in script-src. Tags you add in Tag Manager need their own sources, so keep reporting on: anyone with access can add a tag that your policy then blocks.
Google Analytics 4
Without advertising features:
script-src-elem https://www.googletagmanager.com;
img-src https://www.googletagmanager.com https://*.google-analytics.com;
connect-src https://www.googletagmanager.com https://*.google-analytics.com https://*.google.comWith Google Ads features there are several more, including country domains such as https://*.google.co.uk. Google lists them on the same page.
Google Fonts
style-src https://fonts.googleapis.com;
font-src https://fonts.gstatic.comHosting the fonts yourself removes both, and the connection to Google.
Stripe
Stripe.js and Elements:
script-src https://*.js.stripe.com https://js.stripe.com https://maps.googleapis.com;
frame-src https://*.js.stripe.com https://js.stripe.com https://hooks.stripe.com;
connect-src https://api.stripe.com https://maps.googleapis.comStripe Checkout:
script-src https://checkout.stripe.com;
frame-src https://checkout.stripe.com;
connect-src https://checkout.stripe.com;
img-src https://*.stripe.comLink and Connect embedded components have more, on Stripe's page.
reCAPTCHA
Google recommends a nonce on the script tag. Otherwise:
script-src https://www.google.com/recaptcha/ https://www.gstatic.com/recaptcha/;
frame-src https://www.google.com/recaptcha/ https://recaptcha.google.com/recaptcha/;
connect-src https://www.google.com/recaptcha/Keep the paths. https://www.google.com on its own allows far more than reCAPTCHA.
Source: Google, reCAPTCHA FAQ
Cloudflare Turnstile
script-src https://challenges.cloudflare.com;
frame-src https://challenges.cloudflare.comA nonce on the script tag works too. In pre-clearance mode, connect-src has to include 'self'.
hCaptcha
script-src https://hcaptcha.com https://*.hcaptcha.com;
frame-src https://hcaptcha.com https://*.hcaptcha.com;
style-src https://hcaptcha.com https://*.hcaptcha.com;
connect-src https://hcaptcha.com https://*.hcaptcha.comhCaptcha asks you not to list individual subdomains, because they change.
Source: hCaptcha documentation
Sentry
For the browser loader:
script-src https://browser.sentry-cdn.com https://js.sentry-cdn.com;
connect-src *.sentry.ioAlso add the host in your DSN to connect-src. Bundling the SDK with your own code removes the need for the script hosts.
Source: Sentry, loader script
YouTube embeds
frame-src https://www.youtube.com https://www.youtube-nocookie.comAnything else
Search the vendor's help for “CSP”. If there is nothing, add the service with a report-only policy and see which hosts it uses. Be wary of allowing a shared host such as *.cloudfront.net, where anyone can put a file.
Last checked 24 November 2026.