Google Analytics is a free web analytics software service offered by Google. It helps you to track and monitor your blog traffic accurately.
It also provides the details of who visits your blog, what they do on your blog, how much time users spend on your blog, how they interact with your content and much more. You can use these data to improve your blog.
You can add Google Analytics (GA) to WordPress blog in 3 easy ways. Choose the method you prefer. Let’s check it out all the methods.
Add Google Analytics to WordPress
Adding GA Code to the Header
I highly recommend you to take a backup of the header file before making any changes.
In Google Analytics, copy the code. You can find it by going to Admin section > Tracking info [under property column] > tracking code.
Log into your WordPress dashboard.
Go to Appearance > Editor > header.php.
Now, paste the code above </head> tag or after the opening <body> tag.
Update the file.
That’s it. You’ve successfully added GA (Google Analytics) code to WordPress.
Adding GA Code to Theme
This method is very simple. You can add GA code in your theme if your theme supports (see screenshot).
Just add the code and save the changes. Now, GA should be installed.
There are many WordPress plugins are available to add Google Analytics code. I recommend you to go with any of these plugins.
If you need help with installing plugins, check out our plugin installation guide.
I recommend you to go with the method 2. If your theme doesn’t support, then go with method 3.
After you install Google Analytics in WordPress, go to Google Analytics and make sure that everything is working correctly. It takes Google up to 12-24 hours to give status updates for your blog.