Join our Telegram channel and Group Join Now!

How To Add LazyLoad Google Analytics in Blogger ?

 Now Google makes blog loading speed a ranking factor in search results, so we should optimize the loading of the blog. Here you can use Google PageSpeed Insights to find out why your blog is loading slowly.

Google analytics is one of the blog statistics tool with SEO elements, so we should keep it installed on our blog, we can use Lazy Load Script to overcome google analytics loading problem.

Usually Lazy Load is Often installed on images and Adsense. For example Lazy Load normally works to delay the loading of some items so that they are loaded until scrolling activity occurs and in this post I will share how to lazy load Google Analytics.

What is LazyLoad Google Analytics ?

Lazy Load is a plugin developed by Script Developers to reduce the load on Google Analytics web pages. So by installing this Google Analytics Lazy Load Script you can also improve your website performance, as it temporarily delays the loading of CSS, Javascript, Image files.

The way this Google Analytics Lazy Load Script works is to temporarily delay the loading of Javascript from Google Analytics, and get back to work as you scroll through the web page.

Benefits of Installing LazyLoad Google Analytics Script :-

The advantage of installing Google Analytics Lazy Load Script is that it can lighten the load of Javascript load provided by Google Analytics. Another benefit is that you can increase your score on PageSpeed, GTMetrix, or Web.dev.

Surely visitors will be happier if they reach your website much faster than other websites. That's why you should use this Lazy Load Google Analytics Script.

How To Add LazyLoad Google Analytics in Blogger :-

Installing Google Analytics Lazy Load Script is quite easy, you can copy the script given below. And you need to remember, this script is for those of you who have used Google Analytics to find out your website statistics, and if you haven't installed these tools, you can click here You can install Google Analytics.

Step 1 :- First of All Login Your Blogger Account.
Step 2 :- Then Click on Setting Icon and Remove Google Analytics Property.
Step 3 :- Then Click on Theme Menu After Click on Edit Html.
Step 4 :- Then find the provided old Google Analytics code and delete it.
<script async='async' src='https://www.googletagmanager.com/gtag/js?id=UA-xxxxxxx-x'/>
<script>
//<![CDATA[
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'UA-xxxxxxx-x');
//]]>
</script>
Step 5 :- Then find </body> and then paste the new lazy loaded Google Analytics code given.

<script type="text/javascript">
//<![CDATA[
var lazyanalisis=false;window.addEventListener("scroll",function(){(0!=document.documentElement.scrollTop&&false===lazyanalisis||0!=document.body.scrollTop&&false===lazyanalisis)&&(!function(){var e=document.createElement("script");e.type="text/javascript",e.async=true,e.src="https://www.googletagmanager.com/gtag/js?id=UA-163xxxxxx";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(e,a)}(),lazyanalisis=true)},true); window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag('js',new Date());gtag('config','UA-163xxxxxx');
//]]></script>

Note :- Change the Google Analytics Tracker ID I Have Marked.

Step 6 :- Then Don't Forget to Click on Save and Then See The Result.

Conclusion :-

In this post I have shared with you all How To Add LazyLoad Google Analytics in Blogger. So how did you like this post, you can tell by commenting and if you have any question then you can comment your question. Thanks for visiting our website.

About the Author

Graphic Designer, Web Developer, Ethical Hacker, Programmer, and Content Creator is what I am and overall a Biochemist with the aim of bypassing all restrictions that separate me from my objectives

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.