I'm using (what looks to me like) new Google Analytics tracking code that I got from my account yesterday. It makes use of some "Global site tag". I've placed it at the top of my , as GA instructs, but I'm getting a cross origin error when loading my page, so GA isn't tracking my site correctly.
This is the exact message:
Access to Script at 'https://www.googletagmanager.com/gtag/js?id={my-id}' from origin '{my website}' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header has a value 'http://www.googletagmanager.com' that is not equal to the supplied origin.
The script that is causing this error is included like this
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="//www.googletagmanager.com/gtag/js?id={my-id}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{my-id}');
</script>
That code above is exactly as it comes from Google Analytics, so I'm not sure why it isn't working..
Is anyone able to help?