Wondering how to paste tracking code for Google Analytics into your WordPress site?
In this article I’m going to show you three methods for installing Google Analytics in your WordPress site.
But first, what is Google Analytics?
In a nutshell, GA is the most advanced website analytics platform there is. It allows you to track:
- who visits your website
- how they find your website
- what they do once they’re on your website
And the best part? It’s 100% free.
Here are three easy ways of installing Google Analytics in your WordPress website.
In the first two methods, you need your Google Analytics Tracking Code, so let’s take care of that first.
How To Get Your Google Analytics Tracking Code
Log in to your Google Analytics account and scroll down to the bottom of the left-side panel, and click on ‘Admin’:
On the next screen, go to the centre column titled ‘Property’ and click on the tab that says ‘Tracking Info’:
Under ‘Tracking Info’, click on ‘Tracking Code’:
You’ll now see your Google Analytics Tracking Code (aka ‘Global Site Tag for Google Analytics’):
Method #1 – Install Google Analytics Tracking Code Without a Plugin
In your WordPress dashboard, go to ‘Appearance’ > ‘Editor’ and then ‘Theme Header’.
Then just drop the code in to the box provided.
I use a WordPress on the Genesis Framework, so I can’t show you screenshots for the above procedure.
This is how to do it in Genesis:
First, click on Genesis and then Theme Settings:
Then scroll down to the box titled ‘Header Scripts’ and drop your Google Analytics Tracking Code in the box:
And that’s it – your WordPress site is now connected to Google Analytics.
Method #2 - Install GA Tracking Code using ‘Headers and Footers’ plugin
First go to ‘Plugins’ > ‘Add New’ and search for ‘insert headers and footers’ and click ‘Install Now’:
Then click ‘Activate’:
Next, click on ‘Settings’ in the left-side panel, and then click on ‘Insert Headers and Footers’:
Now just drop your Google Analytics Tracking Code into the ‘Scripts in Header’ box and press ‘Save’:
Method #3 – Install Google Analytics using Monster Insights
Go to ‘Plugins’ > ‘Add New’ and search for ‘monster insights’:
Find the plugin titled ‘Google Analytics Dashboard Plugin for WordPress by MonsterInsights’ and click ‘Install Now’. Then click ‘Activate’.
Next, look for the ‘Insights’ tab in the left-side panel of your WordPress dashboard:
Click on ‘Settings’ and then click ‘Authenticate with your Google account’:
On the next screen click on your Google account that is linked to Google Analytics:
On the next screen click the ‘Allow’ button:
Then choose the Google Analytics profile that you want to connect with:
You should now see a message in the Monster Insights plugin saying that your Analytics profile is now active.
That’s it – you’re now set up to get Google Analytics metrics for your website.
This post was most recently updated on July 22nd, 2020