How To Install Google Analytics For WordPress

If you run a website then having the data on how many visitors your website is receiving or where they are coming from is necessary. Google Analytics is one such free service that allows you to know and understand your visitors.

Installing Google Analytics in WordPress

Integrating Google Analytics on your WordPress website can be done in many ways. We are going to cover the best methods below.


You will first need to signup with Google Analytics. You can visit this link to signup. After signing up, adding your website is pretty straightforward. Just fill in the details related to your website.

Installing Google Analytics by adding the code in your theme file

The best way to add Google analytics tracking code on your website is to insert the code in the header.php file. This allows Google to track every page that is loaded on your website.

Edit your header.php file and paste the tracking code from the Google Analytics website just below the <body> tag. Save the file and Google analytics should now be integrated on your website.

Installing Google Analytics using a plugin

There are many plugins for installing Google Analytics on your website. We will be using the Google Analytics Dashboard Plugin for WordPress by MonsterInsights.

Steps to install Google Analytics using the plugin:
  1. Install and activate the plugin.
  2. You will find a new menu item called Insights in your admin dashboard. Click it.
  3. A setup wizard will now open.
  4. Select the appropriate category and click on the Save and Continue button.
  5. Now click the Connect MonsterInsights button.
  6. You will now need to sign in to your Google account through which you created the Google analytics account.
  7. You will now be presented with a list of permissions that MonsterInsights is requesting. Click on the Allow button.
  8. Select your website from the drop down menu and click on the Complete Connection button. Google Analytics is now integrated on your website.
  9. The default settings should take care of everything but if you want to configure the settings you can do it and click on the Save and Continue button.
  10. You can click on the Skip button for the next steps.
  11. In the end you will be presented with a Finish Setup & Exit Wizard button, click on it.

MonsterInsights also allows you to view your reports from within your admin dashboard. Simply visit Insights -> Reports from your admin dashboard.

Final Thoughts

Google Analytics is a very important tool that anyone running a website should use. It helps give you valuable information regarding your visitors behavior, where they are coming from, how long they are staying on your website and many more things.

Have questions or confused about something WordPress Related? Join Our Discord Server & ask a Question

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top
Scroll to Top