You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to #4, but CSP headers need to be added even if it's not served from a custom subdomain. I think these instructions should be much more upfront, maybe here: https://docs.plausible.io/plausible-script
In particular I think it would be helpful to note specifically which CSP policies need to be edited, and provide some examples. e.g.
Stricter CSP (more precise, but can break if the implementation is changed, like reporting back to a different subdomain) (the script-src and connect-src policies need to be merged with any other existing domains for those directives
Thanks Lou! The reason we don't mention it much is because it doesn't seem to be a big problem for vast majority so didn't want to "clutter" the instructions with edge cases. Only heard from 2 people about CSP out of thousands who've used Plausible. Either most people don't use CSP or those that do are aware that they need to edit their policies for new services they add.
Reacted by Jeremiah Lee, Witt A., JINN/Z, mark-rgmedia and ant0nioli
based on my trials and errors it is recommended to insert a nonce to the script tags generated
in addition it would be sensible to offer the script tags as two one-liners, since the larger script appears to be multi-line
Activity
metmarkosaric commentedon Sep 24, 2020
Thanks Lou! The reason we don't mention it much is because it doesn't seem to be a big problem for vast majority so didn't want to "clutter" the instructions with edge cases. Only heard from 2 people about CSP out of thousands who've used Plausible. Either most people don't use CSP or those that do are aware that they need to edit their policies for new services they add.
divinerites commentedon May 8, 2022
FYI in my
plausible-hugo module, there is a dedicatedpartialfor taking care of plausible in your CSPmetmarkosaric commentedon May 13, 2022
thanks! i've added a note about CSP with a link to this thread on our troubleshoot your integration docs page
jeremiahlee commentedon Nov 21, 2024
Adding to the above recommendation to include
https://:Content-Security-Policy: default-src 'self'; script-src https://plausible.io; connect-src https://plausible.ioJLT032 commentedon Sep 30, 2026
based on my trials and errors it is recommended to insert a nonce to the script tags generated
in addition it would be sensible to offer the script tags as two one-liners, since the larger script appears to be multi-line
example:
this also requires for the script-src to be set as