Lazy Load Google Analytics for Blogger / Website

Lazy Load Google Analytics for Blogger / Website

Google Analytics is the most widely used tool by Bloggers to accurately analyze or view the status of their blog visitors. By using Google Analytics on a blog, we can know the number of blog visitors, the origin area and even the static behavior of visitors to the blog. Google Analytics is actually considered to be the most accurate traffic tracking tool for now.

However, it is not uncommon for bloggers to complain about a problem that is 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 problems like this. The first way is to lighten the Google analytics script and the second is to install the lazy load Google analytics script on the Blogger Website.

Before lazy load was installed, the score was only 85 - 89. And after lazy load was installed, 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 lazy load Google Analytics on the blog below.

How To Add Lazy Load Google Analytics in Blogger

1). First of all you need Go To Blogger.Com.

2). Login to Your Blogger Account > Select Your Desire Blog.

3). Then Click on Theme Menu.

4). After this Click on Edit HTML.

5). Then find the previous Google analytics script and remove it.

6). After That Put the below code before the tag </body>.

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="";var a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(e,a)}(),lazyanalisis=!0)},!0);
  function gtag(){dataLayer.push(arguments);}
  gtag(&quot;js&quot;,new Date());

UA-XXXXXXXXX-X Change with your Google Analytics Tracking ID.

7). Then click save and check whether the loading of the blog and the speed score increases. It should have increased.

FAQ About 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.

Advantages / 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 Google PageSpeed, GTMetrix, or

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.

Disadvantages of Lazy Load Google Analytics ?

This will explicitly exclude all users who close their browser before your intentional delay is over. So the count would be wrong. And it will significantly affect the "Bounce rate" number reported in Google Analytics. I recommend not trying to improve the page load times of Google Analytics. Google has already invested a lot in the effort to optimize this. And every site that uses Google Analytics is paying the same load time penalty.

So it's an even playing field. Just follow their best practices for where to put the code snippets and look for other opportunities to improve page load times.