Know who is visiting your WordPress site by setting up Google Analytics. Even if your blog is brand new, set this up now so that when you need to start analyzing your web traffic you are ready to go. In this guide, I will teach you how to set up Google Analytics for your website in multiple ways.
Set Up Your Google Analytics Account
Setting up your Google Analytics account is the first step to adding Google Analytics to your WordPress site. Below I will go through step-by-step how to sign up for Google Analytics. If you already have a Google Analytics account and are just wanting to know how to add it to your WordPress site, skip ahead to here.
Let’s create your account! Go to Google Analytics and click Start for free.
Log in to your existing Google account, or create a new account for free.
If you’ve never logged into Google Analytics before, you will be sent to this page. Click on Start measuring.
1. Account Setup
Now you will be prompted to create an account.
Under Account Name type the name of your blog or WordPress site.
Account Data Sharing Settings is a list of four types of data sharing with Google. Google recommends selecting them all, but it’s your choice. I’ve opted to select all of them.
Click Next.
2. Measure your website
Google wants to now what you’re measuring in the next step. Select Measure your website.
Click Next.
3. Property Setup
Now enter more info about your website.
- Website Name: Your blog or website name.
- Website URL: Make sure you select http or https, and type your website URL.
- Industry Category: This one is not required. If your blog or website falls into one of these categories feel free to select the appropriate one.
- Reporting Time Zone: Set your time zone.
Click Create.
Next, you will be prompted to read and agree to Google’s Terms of Service and then you will be taken directly to the tracking code page.
Here’s your website’s tracking ID and Global Site Tag. Leave this page open until you set up the tracking on your website, for easy copy and pasting.
Add Google Analytics Tracking to Your WordPress Site
In the previous step, you should have your tracking ID and Global Site Tag ready to copy and paste. If you need to find it again, check out the step below or if you already have it skip ahead.
Need to Locate Your Tracking ID and Global Site Tag Again?
Go to your Google Analytics account. On the bottom left corner locate the gear icon for the admin panel. Find the Property column and then click Tracking Info > Tracking Code.
Now you should have access to your Tracking ID and Global Site Tag again.
This post may contain affiliate links. I may earn a small commission from purchases made through them, at no additional cost to you. Please see my Disclosure Policy for more details.
4 Different Ways to Add Google Analytics to WordPress
There are so many ways to add Google Analytics to your WordPress site, so I’ve included four different guides on how to do this. So pick the way the best meets the needs of your WordPress site.
- Using the Free Astra WordPress Theme
- Using Astra Pro WordPress Theme
- Using Jupiter X WordPress Theme
- Using the MonsterInsights Plugin
Tip: If you have a premium WordPress theme, it’s quite possible your theme already has the option to add your Google Tracking ID. Delve a little deeper into what your theme has to offer, you might be surprised. That’s why several of my tutorials below illustrate how to add Google Analytics using specific themes.
Another Tip: Only add Google Analytics to your WordPress site once! You only need it on your site one time. So only pick one way to add it to your site, and then you are done.
→ Add Google Analytics Using the Free Astra WordPress Theme ←
If you have the free version of the Astra WordPress theme, here’s your tutorial.
Download the Astra Hooks plugin. From your WordPress dashboard, go to Plugins > Add New > Upload Plugin > Choose File. Now choose the plugin file you just downloaded, Install Now, and Activate.
From your WordPress dashboard, go to Appearance > Customize > Hooks > Header.
Copy the entire Global Tracking Tag from your Google Analytics and paste in the wp_head box and hit Publish.
Done!
→ Add Google Analytics Using Astra Pro WordPress Theme ←
If you have the Astra Pro WordPress theme, these step-by-step instructions are for you.
From the WordPress dashboard, go to Plugins > Installed Plugins. Locate the Astra Pro plugin and select Settings.
Under Available Astra Pro Modules, navigate to Custom Layouts and Activate it, if it’s not already.
Now, navigate to Appearance > Custom Layouts > Add New.
Here you will create a custom layout as follows:
Add a title in the Add title box. Something that explains what it is, like “Google Analytics Code”. Next select Enable Code Editor.
Copy the entire Global Site Tag tracking code from your Google Analytics and paste it into the code box.
Scroll down to Custom Layout Settings. Under Layout, select Hooks, and for Action, choose wp_head.
For Display On, choose Entire Website.
Last, hit Publish. You are done!
→ Add Google Analytics Using Jupiter X WordPress Theme ←
If you have the Jupiter X WordPress theme, this guide is for you.
From your WordPress dashboard, go to Jupiter X > Control Panel > Settings.
Find the Google Analytics ID box and paste your Tracking ID here. Scroll to the bottom and Save Settings.
Done!
→ Add Google Analytics Using MonsterInsights ←
From the WordPress Dashboard, navigate to Plugins > Add New. Search for MonsterInsights. Install and Activate the MonsterInsights plugin.
Once you hit activate, MonsterInsights will send you to their setup wizard. Here they will prompt you to set up your account. Follow the steps they provide. It’s a quick process and does not require you needing to have access to your Google Analytics tracking code, but rather it links your Google Analytics account directly with your WordPress site.
This is the free version of their plugin and it allows you to see limited analytic reports directly on your WordPress Dashboard, which is pretty convenient.
How Do You Know If You Set Up Google Analytics Correctly?
Let’s go back to the page where you grabbed your Google Analytics tracking codes.
Or here is a quick refresher on how to find your Google Analytics tracking codes, if you aren’t already on that page:
Find Your Google Analytics Tracking Codes: Go to your Google Analytics account. On the bottom left corner locate the gear icon for the admin panel. Find the Property column and then click Tracking Info > Tracking Code.
Once you are on the tracking code page, to the right of the Tracking ID is Status, which tells you if your website has had any activity on it. If you just set up your Google Analytics on your WordPress site, it probably looks something like this:
So if the status says “No data received in the past 48 hours”, let’s test it and see if it works. Click on the Send test traffic button. A new window will open with your website, which will send a test visit to your site. If you set it up correctly, the status should update to show something like this:
Now you have Google Analytics on your site!
RELATED: HOW TO SET UP GOOGLE SEARCH CONSOLE
Pingback: How to Set Up Google Search Console • Blog There