On this page
What this issue is
A Content-Security-Policy is an HTTP response header. It gives the browser a list of places your page is allowed to load scripts, styles, images, frames and form targets from. Anything not on the list is blocked.
If the header is missing, the browser applies no such limit. A malicious script added through a hacked plugin, a compromised third-party tag or a cross-site scripting (XSS) hole can load more code from anywhere and send data wherever it likes.
Why it costs you leads or sales
Without a CSP, one injected script on a checkout or lead form page can copy what visitors type, redirect them, or add a fake form. Visitors who see a warning or lose card data stop trusting you. Search engines and ad platforms can also flag a hacked site, which can pause your campaigns.
There is a second cost in the other direction: a badly written CSP blocks your own form scripts, chat widget or ad tags. That is why the fix needs care.
- Visitor opens form pagePage loads normally
- Injected script loadsNo CSP to block an unknown domain
- Form data copiedDetails sent to a third party
- Trust and leads lostWarnings, refunds, paused ads
Without a CSP the browser has no rule to stop the foreign script.
How to check if your site has it
Use browser DevTools
Open your page, press F12, go to the Network tab, reload, click the first document request and look under Response Headers for content-security-policy.
Or use the command line
Run the command below and look for a content-security-policy line. No line means no CSP.
Check key page types
Test the home page, a form page and checkout. Headers can differ by path, especially behind a CDN or on a hosted checkout.
curl -sI https://www.example.com/ | grep -i content-security-policyHow to fix it
The safe route is to start with Content-Security-Policy-Report-Only. The browser reports what it would block but blocks nothing. Review the console messages, add the domains you trust, then switch to the enforcing header.
List what your pages load
Note every domain for forms, payments, chat, fonts, video and tracking tags (for example Google Tag Manager, Meta, LinkedIn).
Send the report-only header
Add the starter policy below with the header name Content-Security-Policy-Report-Only.
Test your journeys
Submit a form, open the chat, run a test checkout. Read the console for 'Refused to load' style messages and add the needed domains.
Enforce
When the console is quiet, rename the header to Content-Security-Policy.
Tighten over time
Move away from 'unsafe-inline' using nonces or hashes where your setup allows it.
Content-Security-Policy-Report-Only: default-src 'self'; script-src 'self' 'unsafe-inline' https://www.googletagmanager.com https://www.google-analytics.com; img-src 'self' data: https:; style-src 'self' 'unsafe-inline'; connect-src 'self' https://www.google-analytics.com https://*.analytics.google.com; frame-ancestors 'self'; form-action 'self'; base-uri 'self'Use a headers plugin or server config
Use a security headers plugin that supports Content-Security-Policy, or add the header in your server config (nginx or .htaccess). Start with report-only.
Watch plugin scripts
Form, chat and page builder plugins often use inline scripts, so expect to allow 'unsafe-inline' at first.
Know the limits
Shopify controls response headers on its storefront and checkout, and a custom CSP header generally cannot be set there. Check Shopify's current documentation before relying on one.
Reduce risk instead
Remove unused apps and third-party scripts, and review what is added in theme.liquid and Customer events.
Allow GTM in the policy
GTM does not set the header, but your CSP must allow https://www.googletagmanager.com and every domain your tags call.
Prefer nonces
Custom HTML tags are inline scripts. A nonce-based policy lets them run without 'unsafe-inline'.
Check hosting options
Webflow hosting has limited custom header support. If it is not available, put a CDN or proxy such as Cloudflare in front and add the header there, or use a meta tag as a partial fallback.
Check what you can control
Funnel pages are hosted by the platform, so custom headers may not be possible. If you use a custom domain behind your own proxy, add the header at the proxy.
Expect limited control
Wix manages response headers itself. Review Custom Code snippets and remove scripts you do not need.
Expect limited control
Squarespace does not offer custom response headers in standard plans. Keep Code Injection to trusted scripts only.
Set it at the server
Add the header in nginx, Apache or your app framework. Example for nginx below.
add_header Content-Security-Policy-Report-Only "default-src 'self'; script-src 'self' https://www.googletagmanager.com; img-src 'self' data: https:; frame-ancestors 'self'" always;<IfModule mod_headers.c>
Header set Content-Security-Policy-Report-Only "default-src 'self'; script-src 'self' https://www.googletagmanager.com; img-src 'self' data: https:; frame-ancestors 'self'"
</IfModule>No CSP
- Browser loads scripts from any domain
- Injected code can send data anywhere
- No visibility into what pages load
Tuned CSP
- Only approved domains can load scripts
- Unknown script sources are blocked
- Forms, chat and tracking still work
How to confirm it's fixed
- curl or DevTools shows the content-security-policy header on home, form and checkout pages
- The browser console shows no 'Refused to load' errors for your own scripts
- A test form submission reaches your inbox or CRM
- Tag Assistant or the Network tab shows GA4, Google Ads and Meta hits still firing
- Chat, video and payment widgets still load
How to prevent it happening again
Treat the CSP as part of your tag change process. Every time someone adds a new pixel, widget or form tool, add its domain to the policy first. Keep a short list of approved domains and review it when you remove tools.
Run a header check after theme, CDN or hosting changes, since they can drop or overwrite headers.
Week 1
Audit domains and add the report-only header
Week 2
Fix console warnings, test forms and checkout
Week 3
Switch to enforcing on a low-traffic page first
Week 4
Enforce site-wide and confirm tags still fire
How FunnelGuard handles this
FunnelGuard does not check for a missing Content-Security-Policy today. It is a possible future check, not a current feature.
What it does cover nearby is the damage a bad CSP can cause. A robot visitor runs your real journeys on a schedule, checks each step, and checks the tracking hits sent to GA4, Google Ads, Meta and other platforms, and whether test leads reach the inbox and CRM. If an enforced CSP blocked a form script or a tag, that journey failure would show up. It would not tell you the header itself is missing.
To watch for the header itself, run the curl command above after releases, or use a free online security header scanner on a schedule. You can start with the free plan (1 site, 2 journeys, daily checks) to keep an eye on your forms and tracking while you tune a policy.
Questions people ask
What is a Content-Security-Policy header?
It is an HTTP response header that tells the browser which sources your page may load scripts, styles, images, frames and form targets from. Anything outside the list is blocked. It limits the damage from injected or compromised scripts.
Why is my site missing a Content-Security-Policy?
Servers and CMS platforms do not send one by default, because a correct policy depends on the specific tools your site uses. You have to define and add it yourself at the server, CDN or through a plugin.
How do I check if my website has a CSP header?
Open DevTools, go to the Network tab, reload and click the page request, then look for content-security-policy under Response Headers. Or run curl -sI on your URL and search for the header name.
Will adding a CSP break my tracking or forms?
It can if the policy does not allow the domains your tags, forms and widgets use. Start with Content-Security-Policy-Report-Only, fix the console warnings, then enforce, and test a form and your conversion tags afterwards.
What is CSP report-only mode?
Report-only mode uses the header Content-Security-Policy-Report-Only. The browser logs what the policy would block but blocks nothing, so you can tune the rules safely before enforcing them.
Can I add a CSP on Shopify, Wix or Squarespace?
Usually not as a full response header, because these platforms control headers themselves. Check their current documentation, and focus on removing unneeded scripts and apps instead.
Does FunnelGuard detect a missing Content-Security-Policy?
No. FunnelGuard does not check this yet. It can show if a journey or tracking hit breaks after you change your policy, and you can check the header yourself with curl or a header scanner.
Related issues
- OPS-171Missing X-Frame-Options / frame-ancestors (clickjacking)Fix guide
- OPS-172Missing X-Content-Type-OptionsFix guide
- OPS-173Missing Referrer-Policy (URLs with PII leak to third parties)Fix guide
- OPS-174Missing Permissions-PolicyFix guide
- OPS-177Reflected XSS in form fields or searchFix guide
- OPS-178Stored XSS via form submissions into adminFix guide