If you are a beginner with WordPress and want to add Google Analytics to your site or blog, then the following guide will help to do that.
Integration of Google Analytics is simple. Here, we like to suggest that in setup – only add code to your site, instead of using heavy plugins which show all GA data in WordPress dashboard.
Simple code integration on the website and analyse data on GA dashboard is good practice. By this you can save extra load on your website.
Now, Following are steps to add Google Analytics code to WordPress site or blog.
Table of Contents
1. Create Google Analytics account and get GA code
First requirement to integrate Google Analytics to the WordPress site is a Google Analytics account. You can create an account using your Gmail account.
Next to copy GA4 property code for the website, follow the “Add the global site tag directly to your web page” section in the support page.
And, to copy old Universal Analytics properties code for the website, follow the “Set up the Analytics global site tag” support page.
2. Add GA code to WordPress site using plugin or widget
You can do this by different methods. Here are two simple methods to add GA code in WordPress site.
- Install “Insert Headers and Footers” plugin, and add code in site header section using plugin.
- Add “Custom HTML” widget to sidebar or in available area and add code to widget. GA code will work the same from header, body or footer area.
Once you add GA code using one of above methods, next open your website and confirm that code is available on site. You can do this from page view-source code in the browser.
3. Check Google Analytics stats
After completing the first 2 steps, login to your Google Analytics dashboard and check your site statistics.
In the beginning you will not get all stats, due to less data. But, to make sure your GA integration works properly, you can visit your site page and check real-time statistics in GA dashboard.
Hope you find this post simple and helpful for adding Google Analytics to the WordPress process.