Now that you have your WordPress site up and running, it’s time to start pulling in data that can show you how your visitors interact with your website. In this post we’re going to show you the easiest ways to add the most popular (and free!) website analytics tracking to your website: Google Analytics.
What is Google Analytics?
Google Analytics is a free website tracking service that reports website traffic, conversions, user behavior, and more. It is the most popular website tracking service available.
Google Analytics can show you how much traffic your website receives, where that traffic is coming from, and how visitors interact with your site once they arrive.
You can also export Google Analytics data in various formats or build your own custom “Dashboard” that easily provides and updates the data you want to see.
Why are Website Analytics Important?
What is the primary goal of your website? Maybe your goal is to blog about your passion, launch a small eCommerce business, or just have a space where your friends can come together online.
Whatever your reason for creating a WordPress website, understanding your site’s visitors is crucial. You need to know if people are visiting, where they came from, and what content on your website they enjoy. Without this information, you have no way to measure whether or not the content you’re creating is moving you closer to achieving your goals.
One of the best features of Google Analytics is the fact that it’s free. Even if you are not remotely interested in learning how visitors interact with your website, it’s still easy to implement this tracking and start gathering data quietly in the background, all for free!
Who knows? One day you may look at your analytics data and realize that your visitors frequently visit a page on your site you did not expect them to. That could lead to ideas for new content or copy on your website.
How Does Google Analytics Work?
Implementing Google Analytics involves adding a small snippet of Javascript code to your site that gathers data on how your site is performing, then saves that data to your Google Analytics dashboard. Every time a person lands on your site in their web browser, they are tagged by the tracking code and their “session” on your website begins.
The tracking code (when properly implemented) should be on every page of your website for which you’d like to gather traffic data. This insures that the tracking can follow every website visitor as they move through your site.
Some of the most helpful data provided by this tracking is:
- Sessions: The number of individual visitors your website receives.
- Pageviews: The number of individual pages a visitor goes to on your site.
- Traffic Source: Where your site visitors came from: a Google search, a paid Google ad, another website, directly to your site, a social media network, etc.
- Bounce Rate: A measure of how many visitors came to one page on your site and then immediately left.
- Session Duration and Pages per Session: Measurements of how long a person stayed on your site and how many pages they visited during their session.
- Goals, or “Conversions”: These are a measure of how many people completed an action on your site, as stipulated by you. For example, if you have a contact form, you could measure how many people filled out and submitted that form, where they came from, etc.
Let’s get started by installing Google Analytics on your WordPress website!
How to Install Google Analytics on your Site
Step 1: Create a Google Analytics Account
- The first thing you need in order to add Google Analytics to your website is a Google account. If you don’t already have one, you can create an account here.
- Once your account is ready, log into: https://analytics.google.com
- Finally, you’ll be prompted to sign up for Google Analytics. Follow the remaining few steps to set up your analytics account.
Once you’ve created your Google Analytics account, you’re ready to connect your WordPress site!
Step 2: Connect your WordPress Site to Google Analytics
The next step is to add the Google Analytics tracking code to your WordPress site. Google provides a snippet of code you can add to your site, but that involves editing your site’s code, which can be overwhelming and confusing. So instead, we’re going to focus on a much easier method that doesn’t involve touching code!
In this article, we’ll show you how to set up the MonsterInsights Plugin. With over 2 million active installs, MonsterInsights is the #1 most popular Google Analytics plugin for WordPress, and the #14 most popular WordPress plugin of all time!
Here’s how to set up the MonsterInsights plugin and start tracking your traffic immediately:
- To get started, first download the MonsterInsights plugin from their website. There are several purchase options from which to choose, and even a stripped-down free version, if you prefer.
Download MonsterInsights - Next, install and activate the MonsterInsights plugin. (Here’s a refresher on how to install WordPress plugins.)
- Then, navigate to the “Settings” panel under the new “Insights” menu, and click the button to “Authenticate with your Google account”.
- If you’re not already logged into your Google account, you’ll be prompted to sign in again. Then, you’ll be asked to allow MonsterInsights to connect your Google Analytics account:
- Finally, you’ll be asked to pick a profile with which to connect your site. From the drop-down menu that appears, choose “All Web Site Data” beneath the website that corresponds to the site you’re connecting, then click the button to “Complete Authentication”.
- That’s it! Your site is now successfully tracking your visitor data, and you should begin seeing tracking data appear within the “Reports” section of MonsterInsights within 12-24 hours.
What it Looks Like in Action
When you return to the “Reports” page in MonsterInsights, you’ll find beautiful charts and graphs representing the most useful information about your website traffic. The two primary tabs contain graphs representing your Sessions and Pageviews. And below those charts you’ll find even more detailed information about website traffic… right within your own WordPress dashboard:
The menu at the top allows you to navigate between the different data sections, including detailed metrics on the top 50 Google search terms, eCommerce conversions and much more.
Here are a few sections you’ll want to monitor regularly:
- Sessions: How many unique sessions on your site each day? Can you find weekly or monthly traffic patterns? This can help you learn when to publish new content for maximum visibility.
- Pageviews: When a person visits your site, how many pages are they viewing per session? If they only view one page per session, you likely have a high bounce rate. What changes can you make to encourage visitors to stick around longer?
- New vs. Returning Visitors: What percentage of people are visiting your site for the first time, versus repeat visitors?
- Device Breakdown: Do people visit your site most often from their desktop computer, laptop, tablet, or mobile device? This can help you optimize your site design for the best experience, depending on which device your audience prefers.
- Referrals: What other websites are linking to your site and sending visitors your way? Can you reach out to them?
- Search Console Report: Find the top 50 search terms your visitors used to find your site in Google. This can help you optimize your content for better discovery in search engines.
MonsterInsights makes it really easy to view your most recent traffic data at a glance, but you can also click the links at the bottom of any section to visit your Google Analytics dashboard, where you’ll find even more detailed statistics.
Wrapping Up
Google Analytics is by far the most powerful free analytics service available. It can help you learn more about your audience — which country your visitors are from, what they’re most interested in, which device they prefer to use, their age, gender, and a whole lot more.
This data can help you reach your audience more effectively and make better decisions to grow your business. And MonsterInsights makes it a breeze to properly connect your WordPress site with Google Analytics, so you can get the stats that matter… right inside your WordPress dashboard!
Learn More about MonsterInsights
Happy tracking!
Thank you, this worked wonderfully!
Hello,
I am interested in verifying my sites with Google + Bing, and using Google analytics.
I have seen in Appearance > Editor, you can add code to your site.
Do these changes need to be done in a Child Theme?
I’m worried about making changes, then losing them when I update WordPress, etc.
But I don’t want to mess around in an area that might ‘white screen’ my site!
Thank you for your time.
Sincerely, William.
Shawn Hesketh says
Great question, William.
In short, yes, any changes you make to your theme via Appearance > Editor will be overwritten if/when you update your theme. This is why it’s generally a good idea to use a child theme if you plan to customize your theme at all.
But you don’t need a child theme just to insert code snippets for Google Analytics, or other similar services. In addition to the two methods we mentioned above, many themes also include a field within the Theme Options or settings panel into which you can paste code snippets like this.
For example, all Genesis themes include a “Header and Footer Scripts” meta box in the Theme Settings (screenshot). You can simply paste your code snippets into the header or footer using these fields.
If your theme doesn’t include a similar feature, you might install the Code Snippets plugin to add the same functionality to your site.
Hope this helps!
Maureen Fischer says
I already have Google Analytics on a prior website. Do I need to remove it from that site to add it to my new site? If so, how do I do that?
Ideally, I’d like Google Analytics on both my old and new websites. How can I add it to the new one while retaining it on the old one? I do have two Google email accounts. I thought that might work but it didn’t. Please help! Thanks!
Shawn Hesketh says
Hi Maureen,
You do not have to remove Google Analytics from a prior site before adding it to a new site. In fact, you can add up to 50 websites (Google calls them, “properties”) to each Analytics account. Here are the instructions for how to add a new website to your Google Analytics account. Hope this helps!
sam Zuo says
Hi Shawn,
If I am going without a plug-in and doing the first method, which is to paste the universal tracking code between the header and the body, will google analytics track all of my web pages? Or just 1 page? I am confused about this part.
Thanks so much!
Shawn Hesketh says
It’s a better idea to insert the code in your footer.php file. If you include the code in either the footer or header.php, it will be included in every page in your site, and will therefore track every page in your site. Hope this helps!
Chigs says
Thank you for being so simple and straightforward about it, I appreciate it.
You’re a saviour Shawn! Thanks a mil. I did the Monster Insight plugin before seeing your blog, now I have both. Does it make sense, or should I just delete the plugin?
Shawn Hesketh says
We actually highlight TWO methods for adding Google Analytics to your site — the first is manually adding the code, but the second is to use the MonsterInsights plugin. If you’re already using the MonsterInsights plugin, then you don’t also need to add the code to your site. Personally, I would recommend sticking to the plugin over the code method. Hope this helps!
Tony says
Hey Shawn,
Thanks for your great post. I use the manually adding method.
But I’ve heard that the tracking code i added will disappear once the wordpress or the theme updates… That means I should check the code after every update?
Thank you.
Shawn Hesketh says
That’s correct, Tony. If you install the Google Analytics code manually by editing your theme files, you’ll have to redo the edit every time you upgrade or replace your WordPress theme.
For this reason, I’ve removed that method from this article entirely. It’s a much better idea to use a plugin to add Google Analytics to your site, as it won’t change when you update your site.
Hope this helps!
Very nice information. I was facing some issues while using another plugin for google analytics. After reading your post I installed the plugin that you suggested here and solved all my issues. Thank you very much for sharing.
Manish says
The Monster insights plugin works! Other methods that I found online like inserting the code into the header.php file did not generate any results at all. Thank you for posting this.
Tom L says
Thanks Shawn for the good article! Well made and worded nicely. It’s nice to now go to GA and see my tracking story. I guess it could be called a game changer. Again thanks!