Set up your Content Security Policy
Before you begin
- Access to wherever your site sets its CSP: the
Content-Security-Policyresponse header on your web server, CDN, or hosting platform, or a<meta http-equiv="Content-Security-Policy">tag in your page template. - The list of Conversion features you use on your website. See Directives by feature.
Steps
- Find each feature you use in Directives by feature.
- Add each listed host to the listed directive. Keep the values already in your policy, such as
'self'. - If your policy has a
script-src-elemdirective, add thescript-srchosts to it too. Browsers usescript-src-eleminstead ofscript-srcfor<script>tags when both are set. - If your policy has no
frame-srcdirective, add theframe-srchosts tochild-src, or todefault-srcifchild-srcisn’t set either. Browsers fall back to those directives for iframes. - Publish the updated policy.
- Open a page that uses Conversion in an incognito window, accept tracking if a cookie banner appears, and open your browser’s DevTools → Console.
- Confirm there are no
Refused to load,Refused to connect, orRefused to frameerrors that mention a host from this page.
Directives by feature
Tracking script
The tracking script loads fromp.conversion.ai and sends page visits back to it.
Embedded Conversion forms
An embedded Conversion form is an iframe fromforms.conversion.ai, plus the Forms SDK script that resizes it and passes it the visitor’s tracking context.
The form submits from inside its iframe, so your page doesn’t need
connect-src for it. Everything the form loads inside the iframe, such as its fonts and reCAPTCHA, is covered by Conversion’s own policy on forms.conversion.ai, not by yours.
Conversion’s policy also lets the form display only on pages on your business’s registered base domain. On any other domain, such as a staging site, the browser reports a Refused to frame error that mentions frame-ancestors. Your policy doesn’t cause it, and changing your policy won’t fix it. Turn on Allow any origin for testing in the form’s General settings instead.
Forms submitted with the Forms SDK
When your own code submits a form withConversionFormsV1.submit(), the Forms SDK sends the submission to forms.conversion.ai from your page.
Tracked forms
For a tracked form, the Forms SDK listens for submissions on your page and sends them top.conversion.ai.
Public files
Add this only if you show a public file on your website, such as an image or a video, from Conversion’s default domain.
If you serve files from your own domain, add that origin instead, for example
https://assets.yourcompany.com.
Inline scripts in form snippets
The programmatic submit snippet and theset-values snippet in a form’s settings are inline <script> blocks. If your policy doesn’t allow inline scripts, move that code into a JavaScript file on your site, or allow the block with a nonce or hash in script-src. The embed snippet has no inline script.
Full policy for all features
These are the directives for the tracking script and every kind of Conversion form, combined. Merge them into your existing policy rather than replacing it:script-src-elem only if your policy already uses it. If you show public files from Conversion’s default domain, also add https://conversion-files.com to img-src and media-src.