How to Add Google Analytics to WordPress

Ever wondered how many users are coming to your site? Curious about which pages are getting the most traffic? You can access that information through Google Analytics with a quick setup.

What is Google Analytics?

Google Analtyics is a service provided by Google that shows how much traffic your site is getting. They collect information on any page that you tell Google to collect information on.

Not only do they track page hits, but a variety of other data too. They show historic data, so you can see how your site performed last month for example, and they also display real time data so you can see how many visitors are on your site right now.

They have graphs that show your usage by time of day, devices used to access your website, user retention, region, and much more. If you’re serious about your website or blog then you’re going to need to set up Google Analytics.

sessions-by-country
top-devices
time-of-day-sessions

Get a Google Analytics Tracking ID

So how do we get all this amazing data? The first step is that you’re going to have to create a user account at Google Analytics. Do a Google search for Google Analytics or visit https://analytics.google.com directly to set up your account.

One you have a user account you’re going to need to create an account for your website. Go to the admin page and create a new account, giving it a descriptive name to match your site:

account-setup

The next step is to create a property for your site’s account. You’ll choose the type of property in the next screen. If you don’t have any apps associated with your website you can just choose “Web”:

property-type

After that you’ll enter your website name, URL, industry category and reporting time zone. Don’t forget to select whether your site is http or https in the website URL drop down. I highly recommend using https on your site, as Google is starting to look for that when it’s deciding what sites to serve up in search results.

property-setup

After you’re done with those steps Google will create a tracking ID that you will need to add to your website. The next screen will display your tracking ID and some code that you might need to use to update WordPress depending on if you add the tracking ID to WordPress manually or via a plugin. We’ll talk about that in the next step.

tracking-id

How to Add the Google Analytics Tracking ID to WordPress

Now that you have a tracking ID from Google Analytics you’re going to need to include that tracking ID in WordPress, otherwise Google won’t pick up any of your traffic.

There are a few ways of doing this. If you’re technical and savvy you can add the code manually, but I prefer to use any of the many available plugins that have been created to handle this task.

The plugin I’m using currently is the GA Google Analytics plugin. It’s very simple to use. Just install it, activate it, and add the Tracking ID to the settings page. I typically just select all the defaults after that and save.

google-analytics-plugin
ga-tracking-id

That’s pretty much all there is to tracking traffic on your WordPress site with Google Analytics. Google Analytics gives a lot of insight into what content on your blog or website is getting the most attention and it should be a tool you have in your arsenal to help you get the most out of WordPress that you can.

2 thoughts on “How to Add Google Analytics to WordPress

Leave a Reply

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