Enable Content Security Policy for Task Analytics

Enable Content Security Policy (CSP)


What's Content Security Policy (CPS)

Content Security Policy (CSP) is an added layer of security that helps to detect and mitigate certain types of attacks, including Cross Site Scripting (XSS) and data injection attacks. These attacks are used for everything from data theft to site defacement to distribution of malware.

Changes needed to the Task Analytics script

When you use Content Security Policy to mitigate XSS attacks you need to make a few changes to get our survey to run.
  • Since inline scripts are disabled with most CSP setups you will have to copy our script code into a script file named taskanalytics.js, save it on your server and include it using a <script>-tag in your rendered HTML
  • Our script relies on embedding scripts from the domain in.taskanalytics.com so you will have to adjust your CSP to reflect this.
    An example of a valid CSP is: default-src 'none';script-src 'self' in.taskanalytics.com