Hotjar is not working with a Cloudflare domain

my website has a Cloudflare and recently I installed a Hotjar code. The tracking code detects the webstite, but hotjar doesn’t record anything, and if you go to the console, it throws the next error:

modules.225922caca3b0d1d55e3.js:1 Refused to connect to 'wss://ws10.hotjar.com/api/v1/client/ws' because it violates the following Content Security Policy directive: "default-src 'self' http: https: data: blob: 'unsafe-inline'". Note that 'connect-src' was not explicitly set, so 'default-src' is used as a fallback.

I think it can be the cloudflare? I don’t know

Thx!

That sure looks like a CSP problem at your site. If you posted your URL, we could check for sure.

Sure, I think it works with Safari, I don’t understand :S

https://www.magarrent.com/

Safari Console is showing me the same error. So it’s definitely your CSP that’s blocking it, not Cloudflare.

Okay… And what is the solution? What is the cause

Either update or delete your CSP header. This header isn’t coming from Cloudflare, so you’ll have to track it down within your hosting.

Wow that’s true, Thx!

In my nginx config I have this:

add_header Content-Security-Policy "default-src 'self' http: https: data: blob: 'unsafe-inline'" always;

I tried to fix it but I don’t know exactly how, can you help me? I don’t know where to add the connect-src or how.

Thx so much!

This topic was automatically closed after 31 days. New replies are no longer allowed.