Google Analytics is blocked by CSP policy

Hi,

I try to set up Google Analytics but no luck.
Here is what I did:

  • ga universal tracking code: My analytics ID
  • ga universal domain name: mysite.com (without www)
  • content security policy script src: I added “https://www.google-analytics.com/

But I still don’t receive any hits. When I check with GTmetric then the google analytics js is blocked

Am I missing something?

1 Like

It’s blocked for me too on all websites thanks to Firefox’s content blocking. Are you using Firefox? Or some plugin that blocks ads and tracking?

3 Likes

It works for me now.

My solusion is UNCHECK the content security policy. This one is enable by default. Maybe some expert advice here?

The first piece of advice would be don’t disable CSP.

The security of your site is vastly more important than cutting corners implementing analytics correctly.

8 Likes

Google’s article for tag manager suggests you might need to add https://ssl.google-analytics.com for Analytics.

5 Likes

If I enable CSP and add this one, then still doesn’t work.