Amazon's Early Black Friday Deals are going live now. Check out here.

How to Add Google Analytics to WordPress Blog

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

1

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.
  • adding google analytics code to header.php
  • Update the file.

That’s it. You’ve successfully added GA (Google Analytics) code to WordPress.

2

Adding GA Code to Theme

This method is very simple. You can add GA code in your theme if your theme supports (see screenshot).

Adding Google Analytics code to wordpress via theme inbuilt feature

Just add the code and save the changes. Now, GA should be installed.

3

WordPress Plugins

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.


Final Thoughts

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.

I hope that the information in this post is useful to you. If you find the information in this post useful, share this post with your friends.​

How to Add Google Analytics to WordPress Blog

Click to Tweet This Post

Also see: