Where NOT to put your Google Analytic Code!

[ez-toc]

[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 an experienced front-end software engineer, WordPress specialist, and web consultant with over 12 years in the tech industry. Although he holds a medical degree from Rajshahi Medical University, he chose to follow his true passion for web development. Since then, he has designed and developed intuitive websites and applications across a range of industries utilizing his proficiency in various programming languages to improve user experiences.
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.
We’re a team of experts dedicated to delivering high-quality, easy-to-use WordPress themes. Our mission? To simplify website building, so you can focus on growing your business and reaching your audience.
Theme categories

© 2024 TallyThemes.Com, a Rapid Website Design company. All rights reserved.