This post only applies to a self-hosted WordPress website.
There aren’t that many ways that you can track your blog’s stats. Even though the JetPack statistics are already integrated with WordPress and easy to use, they are not always accurate, and they lack a lot of important data. To have the best results, you want to use Google Analytics! It can look a bit scary and complicated to set up, but it doesn’t have to be.
Just follow the steps below and in a few minutes, your website will be tracked correctly!
How to Install Google Analytics
There are a few ways you can install Google Analytics on your site, but it you’re new to WordPress and coding in general, it’s not the time to tell you how to add the code to your header.php file. Instead, I’ll show you the easy way: the plugin way.
Yes, there are lots of plugins out there that can install Google Analytics on your website in a few seconds, and you should use them. No, having too many plugins isn’t the greatest, but it’s a lot better than breaking your website or not tracking the data at all, isn’t it?
So follow those easy steps to a better tracking!
1. Install the Google Analytics Dashboard for WP plugin
In your Admin Dashboard, go to Plugins > Add New and search for Google Analytics Dashboard for WP. You can also go to their plugin page, download the zip file and upload it yourself using the Upload Plugin button at the top. Once that is done, make sure you activate it.
2. Set Up the Plugin
Go to Google Analytics > General Settings. Once you are in the plugin settings, click on Authorize Plugin. You will not be using your own API credentials, so don’t check that box. Next, click on the Get The Access Code link. You’ll need to have already a Gmail account at this time. Select the one you use for your Google Analytics and allow it. Copy the code the website generated and paste it into the General Settings page. Once you’re done, make sure you select the right profile so that your data is in the right place.
You’re done! That wasn’t too hard, wasn’t it? It’s pretty simple actually. So if you only do that, Google Analytics will be installed on your website, and you even get your stats on your dashboard, so you don’t have to log in to GA ever! (Except when you want extra stats, of course!)
Other Ways to Install Google Analytics
I won’t go deep into those other methods, but I just wanted to mention them, so you know there are other ways. The first one is to copy and paste the tracking code into your header.php. The simplest way to do that is by either going to Appearance > Editor and paste the code in the right file or use FTP. This is, of course, for the most advanced bloggers out there. There are risks with this method, as PHP files are very sensitive, and if you paste the code in the wrong place, you can end up with a blank page and no way to access your website anymore. Only use this method if you know how to do it!
For people using the Genesis Framework, you can actually copy the tracking code in Genesis > Themes Settings. At the bottom of the page, there is a Header box, where you can copy scripts. That’s where you want to do it! That way, you wouldn’t have to install an extra plugin, but that only applies to Genesis users.
BONUS: How To Check If You’ve Installed Google Analytics Properly
I discovered this awesome trick while I wanted to make sure GA was installed on this very website. Google created an extension called Tag Assistant that you can download on the web store. Make sure you are using Google Chrome, though, as you won’t find that extension anywhere else. Once you’ve added it to Chrome, go back to your website and click on the new icon that just appeared on the top-right corner of your browser. It’ll tell you if you’ve installed GA properly or not, as the tracking might take a little while to kick in.
I hope this helps you! Let me know in the comments if you’ve encountered any problems while installing Google Analytics!