Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google chrome doesn't load analytics.js

I am developping an Angular 6 application, and I want to use Google Analytics on it. The problem is that google chrome does not load the analytics.js script and gives the following error message:

Failed to load resource: net::ERR_TIMED_OUT

I want to note that the script works very well in Opera with VPN activated. Here is the script I added to the index.html file

<script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
        (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
        m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');


    ga('create', 'UA-XXXXXXXXXX-ID', 'auto');
</script>

Thank You.

like image 694
Laiso Avatar asked May 22 '26 02:05

Laiso


2 Answers

Maybe your chrome is under a proxy, please check.

like image 61
maheryhaja Avatar answered May 24 '26 16:05

maheryhaja


If it works in other browsers
Check to see if you have any extensions running
There are several blockers that do not allow access to trackers like Google Analytics
I turn all of mine off when I need to test

like image 36
Mathias Avatar answered May 24 '26 16:05

Mathias



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!