Installing with Content Security Policy

If your website uses a Content Security Policy (CSP), your browser blocks content from any source your policy doesn't allow. When you install SatisMeter with the HTML snippet, add SatisMeter to your policy so the widget can load and show your surveys. This article lists the directives to update and shows an example policy.

In this article:

Updating your policy for SatisMeter

Add these values to the directives in your Content-Security-Policy header or meta tag:

Directive What to add
script-src https://app.satismeter.com, plus 'unsafe-inline', a nonce, or a hash for the inline snippet.
connect-src https://app.satismeter.com

Note: SatisMeter doesn't need any fonts, images, or style sheets allowed. You don't need to change font-src, img-src, or style-src for SatisMeter.

Allowing the inline snippet

The SatisMeter snippet runs inline on your page, so script-src must also allow it. Choose one of these options:

  • 'unsafe-inline': Add 'unsafe-inline' to script-src. This is the simplest option, but it allows all inline code on your page.
  • A nonce: Add a nonce attribute to the snippet's <script> tag, and add the matching 'nonce-…' value to script-src. Generate a new nonce for each page load.
  • A hash: Add a hash of the snippet's contents, such as a 'sha256-…' value, to script-src. If you change the snippet, update the hash.

Example policy

This meta tag allows SatisMeter and uses 'unsafe-inline' for the snippet:

<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline' https://app.satismeter.com; connect-src 'self' https://app.satismeter.com;">

If you use a nonce or a hash, replace 'unsafe-inline' with that value. Keep your existing directives for your other sources.

Troubleshooting a survey that doesn't show

If your survey still doesn't show after you update your policy, check your browser console for CSP errors that mention app.satismeter.com or the inline snippet. For more checks, see Survey not showing? Troubleshooting checklist.

See also

Was this article helpful?
0 out of 4 found this helpful

Articles in this section

Our Support hours:
Monday to Friday from 9:00 am - 2:00 am CET. Monday to Friday from 0:00 am - 5:00 pm PST.