Where NOT to put your Google Analytic Code!

[wpm_post_image id=”1″]

Do not expect rocket science English. I am not a native. What I do is solid coding 🙂

Few days ago one of my clients wanted me to put analytic code at the bottom of his website. So I had to write a log email for him. I am just gonna write this article based on that email ( you all know I am a busy man and I like to save time when I can 🙂 )

What was my clients logic?

He wanted me to make his website super fast. He read that if we place the java-script at the bottom of the page it increase page speed. Well, he was right. So what was the play here? If we place the code at the footer ( just before the </body> tag that means the code will load last. That means the page will load faster and once the page loaded the js files will be loaded. No big deal right?

Hell, no. Here is my logic

What actually analytic do? It track people on your website, what they do, how long they stay etc… ( I know, you all know about this ). Say your website loads within 10 seconds. It means if you place the analytic codes at the bottom the analytic code will load after 10 seconds of your website loaded. That means google will blind for those seconds. So it will not track any visitors data for those second and it is too bad for your SEO. Your visitors might have click a link within that 10 seconds and google will never known about it ( you see, even 10 second is here important ). Also you will loose average session duration smaller than the actual time your visitors are spending on your website.

You see my point. If you are going to save 1 second actually you are loosing more to be invisible to google 🙁 Too bad, right?

Where should I place it?

Before the <body> tag. In our WordPress themes we already applied it long ago. Visit here Appearance >> Theme Options >> General Settings >> Google Analytics Code. Just place the code as it is and you are done.

Related Post: 5 Google Analytics Features To Better Understand Your Business

Over 100,000+ Readers
Get fresh content from TallyThemes.Com
Dr. Sabbir | WordPress expert | Kajabi Expert
About The Author
Dr. Sabbir is a seasoned front-end software engineer, WordPress expert, and web consultant with more than 12 years of experience in the tech industry. Despite earning a medical degree from Rajshahi Medical University, he pursued his true passion—web development. Over the years, Dr. Sabbir has crafted user-friendly websites and applications across multiple industries, leveraging his expertise in a variety of programming languages to enhance user experiences and create seamless digital solutions.
Hey, let's take your website to the next level!
Sign up today to unlock exclusive launch-day discounts to accelerate your site's growth. You'll receive insider tips on optimizing your WordPress experience, along with expert strategies for boosting conversions and maintaining a secure, high-performance site.
CAPTCHA

© 2024 WpMania.Net, a Rapid Website Design company. All rights reserved.