Turkish government have blocked some IPs including Google Analytics. This caused all the web sites using alanytics to slow down and even not to load. How can we prevent this problem? How can we skip loading of ga.js if not available?
You can opt-out of having your site activity available to Google Analytics by installing the Google Analytics opt-out browser add-on. The add-on prevents the Google Analytics JavaScript (gtag. js, analytics.
Google offers an asynchronous snippet for their tracking code:
Note that you need to use a different tracking syntax to use it, check the migration guide on the link for details. It also require a browser with support for the HTML5 attribute 'async', so it may not fully solve your problem.
Another solution is proposed in 'Better Google Analytics JavaScript that doesn't block page downloading'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With