You want to add Google Analytics Lazy Loading to your Blogger? The first impression of the increasing user is a website speed, as we all k...
You want to add Google Analytics Lazy Loading to your Blogger?
Google now makes the blog load speed an important search results factor, so we should optimize the blog load. Here you will see why your blog is being loaded slowly by Google Page-speed Insights.
What is Lazy-Loading Google Analytics ?
From a technical point of view, Lazy loading works better for JavaScript that monitors your visitors’ current view and only loads the visible images and script when needed.
Lazy loading only occurs if many visitors reach or scroll down the page. Don’t have to be loaded if you don’t access the pictures.
Are Google analytics Impact on site Loading speed?
Benefits of Installing Lazy-Loading Google Analytics Script :
- The advantage of Google Analytics Lazy Load Scripts is that Google Analytics load after content loaded.
- An additional advantage is that PageSpeed, GTMetrix, and Web.dev score will improve.
- Visitors will surely be happier if they get much faster than other Internet sites on your website.
How To Install Lazy loaded Google Analytics code in Blogger?
<script async=”” src=”https://www.googletagmanager.com/gtag/js?id=G-7QM8RJTJJ9″></script><script>window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag(‘js’, new Date());gtag(‘config’, ‘G-7QM8RJTJJ9’);</script>
- Note Down The google Analytics code that you get from analytics
- Remove The these line code from Analytics Code.
<script async=”” src=”https://www.googletagmanager.com/gtag/js?id=G-7QM8RJTJJ9″></script>
- And Paste These Code.
<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=”<b>https://www.googletagmanager.com/gtag/js?id=G-7QM8RJTJJ9</b>”;var a=document.getElementsByTagName(“script”)[0];a.parentNode.insertBefore(e,a)}(),lazyanalisis=!0)},!0);
//]]></script> - Change The Bold Link From Real Google Analytics code.
- So, After all it your New Code Will Look Like.
<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=”<b>https://www.googletagmanager.com/gtag/js?id=G-7QM8RJTJJ9</b>”;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’, ‘G-7QM8RJTJJ9’);
</script> - Login to Blogger.
- Go to theme section.
- Click to Edit HTML.
- Paste The Code above </body> and save the theme.
COMMENTS