How To Add Lazy Load Google Analytics in Blogger |
Hello Everybody, How are you ? I think you (all) are fine. Finally I am going to post on How To Add Lazy Load Google Analytics in Blogger and How to Speed up Blog Loading By Installing Lazyload Google Analytics in Blogger Website.
Google Analytics is the most widely used tool by bloggers to analyze or view the static of their blog visitors accurately. By using Google analytics on blogs, we can know the number of blog visitors, the area of origin and even see the static behavior of visitors to the blog. Google Analytics is indeed believed to be the most accurate traffic tracking tool for now.
But not infrequently from bloggers who complain about problems that are considered big by some of them, namely that the tracking code provided by Google analytics is very influential on loading their blogs and eventually the blog becomes slow.
Yes, indeed this Google analytics script can burden our blog loading. Just like the tracking meta tags provided by Google Analytics. But don't worry, there are still solutions to this kind of problem. The first way is to lighten the Google analytics script and the second is to install lazy load Google analytics script in Blogger Website.
Before the lazy load was installed, the score only got 85 - 89. And after installing lazy load, the score went up drastically. Do you also want to install this Google analytics lazy load on your blog so that the blog loads quickly? Check out the complete tutorial on how to install Google Analytics lazy load on the blog below.
How To Add Lazy Load Google Analytics in Blogger Website
Method 1 :-
<script type='text/javascript'>
//<![CDATA[
var lazyanalisis=!1;window.addEventListener("scroll",function(){(0!=document.documentElement.scrollTop&&!1===lazyanalisis||0!=document.body.scrollTop&&!1===lazyanalisis)&&(!function(){var e=document.createElement("script");e.type="text/javascript",e.async=!0,e.src="//www.googletagmanager.com/gtag/js?id=UA-XXXXXXXXX-X";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(e,a)}(),lazyanalisis=!0)},!0);
//]]>
</script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-XXXXXXXXX-X');
</script>
Don't forget to replace the text marked with your Analytics tracking ID
Step 6 :-If everything is done click on save.
Method 2 :-
Until this stage Google analytics lazy load has been installed on your blog. You can check the changes whether the speed score increases or remains the same. If it still remains and doesn't increase at all, you can try the second method below.
<script>
//<![CDATA[
var lazyanalisis=!1;window.addEventListener("scroll",function(){(0!=document.documentElement.scrollTop&&!1===lazyanalisis||0!=document.body.scrollTop&&!1===lazyanalisis)&&(!function(){var e=document.createElement("script");e.type="text/javascript",e.async=!0,e.src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXXX-X";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(e,a)}(),lazyanalisis=!0)},!0);
//]]>
</script>
<script>
window.dataLayer=window.dataLayer||[];
function gtag(){dataLayer.push(arguments);}
gtag("js",new Date());
gtag("config","UA-XXXXXXXXX-X");
</script>
Don't forget to replace the text marked with your Analytics tracking ID
Conclusion
Well, that's the great tutorial on how to install Google analytics lazy load on a blog to speed up blog loading that I convey in this article. if you have face any error and problem you can ask in the comment section without any hesitate. Thanks For Reading This Post.
Post a Comment
Post a Comment