The mission today? To teach you to add Google Analytics to WordPress. In pursuit of that goal, I have a video below showing you exactly how to go about doing this. But if you’d like a deeper understanding of all of the whys and wherefores, I’m going to cover some background as well.
What Do You Use to Blog? The Answer Should Probably be WordPress
This particular claim might raise some eyebrows in the programming community. But I’ll throw it out there anyway.
If you have any tech cred and have thought of blogging, you’ve probably looked at Jekyll. What’s not to love? It checks a lot of boxes.
- Content creation uses markdown.
- Generates static sites, so performance is top-notch.
- You publish with the command line.
- It’s got the GitHub dude on the front page, and GitHub is the answer to all of the universe’s problems.
I would dispute none of this in the slightest and say that this (or other static site generators) is a great way to go if you’re interested in journal blogging or showcasing your tech chops. Going this route eliminates a lot of the more distracting options, makes things simpler and about the content, reduces your security risk, and a handful of other concerns besides.
But recall the mission of this blog—we’re talking about how to help you advance your tech-based business through blogging. And for commercial concerns, it’s hard to beat WordPress. For instance, you’ll probably want to do some of these things:
- Have lead magnet and email signup.
- Have pre-themed landing pages.
- Do sophisticated things with SEO.
- Allow non-developers to create and modify content.
I could go on, but you get the idea. And, while you could do any of these things without WordPress or by hand, you’re trying to make money through your blog, not reinvent every wheel in the content world. Save yourself the headache.
Introducing Google Analytics
Alright, I’ll assume I’ve convinced you. Or maybe you just landed here as part of a Google search on the subject, in which case you’ve already got a WordPress instance. Now it’s time to understand a little bit about Google Analytics.
In the very broadest terms, it’s information about who has visited your site. Above is an example of how it works on the relatively nascent Hit Subscribe blog. (Talk about meta-dogfooding.) Here’s what you can see from the default dashboard/home page.
- Hit Subscribe has nobody visiting right at this moment.
- Over the last seven days, 39 people have visited in a total of 51 sessions.
- Our traffic is a lot better than the previous week.
- Our traffic comes at all times of day, without a ton of rhyme or reason.
All of this you can see from the very first glance you take into the tool. Even if you’re brain isn’t yet tracking how you can use all of this to your advantage, it’s at least interesting. Let’s come back to that, though.
Google Analytics: How it Works
Alright, so you’ve got a website. And then, by some alchemy, you get all of this cool data about who visits it. Magic, eh?
Well, not so much. Given that our audience skews heavily technical, you probably can imagine how this works. Still, I’ll dispel any lingering curiosity with a fairly simple and approachable explanation. (You can read here in a lot more detail if you want.)
- You make a Google Analytics account (which you can do with your Google account).
- From that account, you get a little bit of pre-baked JavaScript to install on your website that handles information collection.
- Using tracking cookies, it collects some basic information about visitors and sends it back to Google’s collection and reporting services.
That’s pretty much it. You could theoretically handle the information collection and reporting yourself. But do you recall that whole thing about wheels and not reinventing them? You probably don’t have a few quick scripts lying around that generate the screenshot above.
Why Do These Analytics Matter? And What Are They?
You can actually get your hands on WAY more information than I’ll list here. But I’ll name some of the things I look at most commonly in analytics for sites that I track.
- How many visitors and page views per week/month do I get? (This is something of a vanity metric, but everyone looks at it)
- What’s the trend in my visitor count?
- How long do people stay on the pages, and how many pages do they look at per visit?
- Where, geographically, do my readers come from?
- Which pages/posts are most popular?
- How are people arriving at my site? Who is referring them?
Perhaps you’re getting a better sense of why these things matter from a business perspective as I list more of them. But, either way, let’s get explicit about that.
If you have a site and you’re looking to advance your business, you’re looking to steer visitors through something called the marketing funnel. You want to attract folks for whom your product or service would be a good fit and then use high-quality content to get them to trust you.
But how do you know if they trust you? And what do they consider “high quality” content?
Well, that’s where your analytics come in. If people stay on a page for a long time, it means, in aggregate, they like the content. When they visit multiple pages, it means you’re providing them with such a good experience they want to stay and look around. You can start investigating which pages produce that effect and start trying to generate more of those and less of the ones that prove to be duds.
Your analytics offer a window into your blog/site’s effectiveness at its purpose.
Add Google Analytics to WordPress
Hopefully you’re now convinced of your need for analytics and also that Google does a workmanlike job of providing them to you. Assuming that’s true, let’s take a look at how you go about adding them to your WordPress blog.
Here are the prerequisites for doing this:
- A WordPress instance.
- Enough access to your WordPress instance to install and configure plugins.
- A Google account.
That’s it. Assuming you have those things, this video will walk you through setting this up much more effectively than I could with a bunch of text.
Always Be Learning
It’ll take a bit of time for analytics to get wired up and working, but if you’re anything like me, you’ll find yourself chomping at the bit to see your data.
That’s a good thing!
Harness that feeling and keep hold of it. You really want to make sure that you’re getting—and acting on—the feedback that your readership gives you through Google Analytics. Earlier, I called “number of visits” a vanity metric, and that’s generally true (assuming your goal is some sort of profit-motivated one). But vanity metric or not, it’s data, and any data can help.
As you go along in your content journey, you’ll start to learn to separate the vanity metrics from the profit-driving ones, and you’ll get a sense for what’s most important for you to track. But that’s all fodder for future posts here. (And feel free to subscribe to our RSS feed if you want to check back.) For now, just focus on collecting data and asking and answering questions to satisfy your curiosity about your audience.
I think you’ll find yourself surprised with all that you learn from browsing your analytics.