Do you know which of your posts have been viewed most? Which categories (if your blog supports them) are most popular? How about where your visitors are geographically situated?
If you use Performancing Metrics to monitor how your blog is being viewed, you do. I use them, and I’m learning a lot about my readers’ interests.
Today I’m going to look at my ‘Post Views’, i.e., which posts (articles) are attracting the most reader attention. We’ll begin by looking at the default Performancing Metrics script. I use WordPress as my blogging engine so my default script reflects the WordPress API. If you use another blogging engine (such as Drupal or Moveable Type) I’m going to assume that you can translate the concepts in this article into code for your specific blogging engine.
DEFAULT METRICS SCRIPT
When I first signed-up to use Performancing Metrics, here’s the script they gave me (please note that the line numbers are for our reference only and are not part of the original script):
Hm… welcome to the confusion that would soon dominate my blog-metrics world. You see, WordPress’s ‘the_title()’ function returns the title of the current blog post. Which is absolutely perfect if we’re looking at an individual post. The challenge here is that not everyone who visited my blog was visiting individual posts. Some people came to the home page and read entire posts from there… others came through search engine results and went right to the post itself or, in some cases, were directed to the category archive or a monthly archive on my blog.
After using the default Performancing Metrics script for a few weeks, I found myself viewing my ‘Post Views’ panel with some surprise: posts that I thought would be more popular with my readers sometimes appeared as though they weren’t popular, while other posts that I thought would be less interesting seemed to be getting a lot of unanticipated attention.
Here are a couple of screen shots showing my first week’s Performancing Metrics using the default script for a WordPress blog:
Please notice that every post being counted in this ‘Post Views’ panel is identified only by the the post’s title, i.e., the_title(). There’s nothing at all wrong with title-only nomenclature but as we will soon see, it’s hiding some rather significant details.
It turns out that calling WordPress’s ‘the_title()’ function from any page with more than one post on it — whether the blog homepage, or a category archive, or a date archive, or even a search result — will return only the top-most post’s title on the current blog page.
As I thought more carefully about the mysteriously skewed popularity of my posts, I realized what was going on. This is a subtle point that came upon me as an ‘aha!’ moment and if you haven’t already had the same flash of insight, hold on to your hat!
Let’s say I write just 2 posts a day. I check the online news sources for interesting items. I find one and write about it, publishing to my blog sometime around 8:00am. It’s a real gem of a story and I think to myself, “Wow! My readers are gonna LOVE this!”
About 30 minutes later I find another interesting item. It’s not nearly as significant as the first post I made just a half-hour earlier but I think to myself, “This is kinda cool. It’s not as important as the first post today but maybe some of my readers will find the less-intense content refreshing.” So again I write and publish a post, and off to work I go.
At the end of the day I check my Performancing Metrics numbers on the ‘Post Views’ panel and what do I find? Only a few people seemed interested in the first post but a whole lot more seemed to visit the second post.
I feel a bit confused by these numbers. Do I not really understand my target audience? Do I think I’m writing for one audience but am really getting the attention of another altogether? It seems inconceivable to me that my readers would prefer the second, less-intense post over the first one.
But numbers don’t lie, and there before me are the cold, hard facts. How can I argue with numbers?
DETAIL BEHIND THE NUMBERS
Well, I can’t. And upon further reflection I realized that I didn’t have to.
That first post had been the top-most post on my blog for all of about 30 minutes, while the second post had been top-most on my blog for the remainder of the day — of course! no wonder the numbers looked like they did!
Here’s the subtle but very important conclusion: every time someone visited my blog’s homepage, they would have a chance to read both stories but… the default Performancing Metrics script would capture ‘the_title()’ of the top-most post on the page and tally a view for that, and only that, post.
Both articles may’ve been read… neither one might’ve been read… perhaps only one or the other was read but I couldn’t tell from the Performancing Metrics tally because a view to my blog’s homepage was equivalent — from the Metrics standpoint — with a view of that post alone.
By now you might’ve guessed that if a reader were to have visited that second post’s page, the tally would accrue just as it had for visiting the homepage when that second post was top-most on the page. This effect was magnified even more if a day went by where I didn’t post at all: the last post from the previous day would seem to jump off the scale in popularity with every visit to my blog’s homepage.
TWEAKING METRICS FOR DETAILS
Although I’ve made my living as a software developer since the mid 1980’s, web development hasn’t been a part of my job description. If I was going to attempt to modify my default Performancing Metrics script so that it would give me finer distinctions in the numbers it tracked, I was going to have to learn the PHP scripting language. Specifically, I was going to have to research the WordPress API functions that I’d need to call in order to get this increased granularity that I desired from my Metrics numbers.
If all that I’ve described makes sense to you so far… if you’re nodding your head up and down in agreement that you also want to benefit from this additional level of detail in your Metrics, then let me tell ya: have I got a solution for you!
In contrast with the earlier ‘Post Views’ panel we saw, here’s how Performancing Metrics now labels my blog’s numbers:
Whereas before every entry was a post title and nothing more, now these descriptors include context markers like “Homepage (” in front of the title to show, when a user viewed the homepage, which post was at the top of the page at the time. It also shows things like when a user has viewed a date-driven archive by prefixing either “Month: [” or “Day: [” in front of the post title. Similar results are obtained if the user views by category or by searching for something.
That’s all, folks! Enjoy!