Want to know where should you put your Google Analytics code? While it’s safe to put your code in header or footer, Google recommends you to add your code to your WordPress header. Learn the reason behind it and whether adding Analytics code into the header would impact your site.
The Benefits of Adding Analytics Code into Header
This is why Google recommends you add your tracking code in the header of your site.
It helps you to accurately record traffic stats because your header scripts are loaded earlier than any other scripts on your page.
In addition, the tracking code loads on your site asynchronously, meaning other scripts can also load simultaneously. For that reason, adding your tracking code into your header doesn’t reduce the page speed or impact your WordPress site performance.
There are many ways to add your Google Analytics code snippet into your WordPress site.
The easiest way is to set up your Google Analytics with your WordPress site using the MonsterInsights plugin.
How to Add Your Google Analytics Code into Header
MonsterInsights makes it easy to add your tracking code into your WordPress header without even touching the code.
After you installed and activated MonsterInsights, you can easily add your tracking code into your header by clicking on the Authenticate it with your Google account button by navigating to Insights » Settings in your WordPress dashboard.
Then, you can follow the instructions step by step until you successfully integrate it with your site.
For a more detailed step-by-step tutorial, read setting up Google Analytics in WordPress.
We hope this guide helped you learn about putting Analytics code in your WordPress site.
Once you successfully integrated your website with Google Analytics, you might want to identify your high converting landing pages to optimize your conversions. And don’t forget to follow us on Twitter and Facebook for more Google Analytics tutorials.