Content Analytics Guide

This guide will explain how you can measure your content’s effectiveness after publication with actionable content metrics and analytics. In addition, it will provide code examples that utilize Keen’s core features of Data Collection, Data Analysis, and Data Visualization to create a powerful real-time content analytics engine.

Example of actionable content metrics on Medium.com

What content metrics should I track?

Here are three meaningful metrics used by influential content networks such as Medium and Mashable:

  • Read Percentage: shows if readers actually read your content, or instead, leave shortly after arrival.
  • Content Velocity: indicates the rate of growth a specific post is experiencing relative to past performance, which is an indicator of potential virality.
  • Conversion Percentage: displays what percentage of readers, as a result of reading specific content, convert on a desired outcome, such as becoming a subscriber.

Remarkably, you can produce these metrics with only two Keen Events:

  • Page Views: runs once on page load.
  • Page Scrolls: runs each time a user scrolls through a page.

These same two data events would also allow you to get metrics like User Locations, Referrals, and Total Impressions, making them even more powerful.

Now that you know what to track, it’s time to cover why.

Taking Action

So far we’re focusing on just three metrics. That’s because it’s easy to get overwhelmed by a large set of metrics. Focusing on these three actionable metrics allows you to react in real time to your content’s performance by taking specific actions.

Read Percentage

This metric helps you understand how your readers interact with your content. Here are screenshots from Medium’s Stats page showing how this metric appears in real-world usage:

If you are experiencing a low read percentage on a post, the content might be too long. You can certainly keep that in mind for future posts, but what about improving the average read percentage right away?

Take a look at this chart I made with Keen’s visualization library:

Screen Shot 2016-02-01 at 12.25.45 PM.png

By grouping read percentages by referral medium, you can quickly see which source results in more reads, giving you an accurate answer to where promotion efforts should be directed.

Content Velocity

Content Velocity measures the growth rate of posts over time. On the surface, this metric seems similar to a standard Page Views Metric, but while page views show past performance, Content Velocity predicts future performance, which has huge benefits.

It’s no coincidence that large media companies such as Mashable use Content Velocity to their advantage. In fact, Chris Heald, Chief Architect at Mashable, says “post placement is full algorithmic.” This allows the best content to surface organically. They even make show their proprietary velocity graph on each post:

Screenshot of velocity graph

Luckily, you don’t need to fully automate post placement to take advantage of Content Velocity. By prioritizing the promotion of posts with a higher Content Velocity score, you can accelerate the growth of your top content.

Keep reading to see what a Content Velocity score looks like.

Conversion Percentage

Improving conversion percentage is a common goal, but it’s often difficult to know how exactly to do it. By comparing the conversion percentage of individual posts, you can identify the best performing posts.

Compare these charts that show a conversion funnel for two sponsored posts:

Post 1 (~2.8% conversion)

2.8% Conversion

Post 2 (~5% conversion)

~5% conv

As you can see, the conversion percentage of Post 2 is nearly double that of Post 1. Therefore, it makes sense to focus promotion efforts on Post 2.

Bringing it all together

By tracking Read Percentage, Content Velocity, and Conversion Percentage, you can turn simple Page View and Page Scroll events into an actionable content analytics engine.

Questions about getting content metrics set up for your team? Contact us! Ready to set this up on your own? In the next section, I’ll show you exactly how to set this up.

Content Tracking

With Keen’s Javascript SDK, a few open source libraries, and some simple data modeling, we can correctly track Page View and Page Scroll events.

Here are the code snippets you’ll need for this.

General Setup

$(document).ready(function() {

    // Configure an instance for your project
    var client = new Keen({
      projectId: "YOUR_PROJECT_ID",
      writeKey: "YOUR_WRITE_KEY"
    });

    // User Data
    var user_data = {
        uuid: $.cookie("uuid") // Set on first visit using https://github.com/carhartl/jquery-cookie
    }
    // Page Data
    var page_data = {
        id: $("#post").attr("data-id"),
        title: $("#post").attr("data-title"),
        referrer: document.referrer,
        ip_address: "${keen.ip}", // https://keen.io/docs/api/?javascript#dynamic-placeholders
        user_agent: "${keen.user_agent}"
    }
});

Page Views

client.addEvent("page_views", {
  user: user_data,
  page: page_data
})

Page Scrolls

$(window).scroll(function(event) {
    client.addEvent("page_scrolls", {
        user: user_data,
        page: page_data,
        percentage_read: getPercentageRead(event) // example function modeled after Medium.com's code
    });
});

The above code is all you need to properly track the needed events; however, you may want to enrich certain attributes using Keen’s Data Enrichment tool. For the purpose of this tutorial, it is assumed that the data will be enriched.

Data Analysis & Visualization

Read Percentage

Acquiring the read percentages for each of your posts requires two Queries. A Count Query and Unique Count Query:

var count = new Keen.Query("count", {
  event_collection: "page_scrolls",
  timeframe: "this_24_hours",
  group_by: "page.id"
});


// Gets number of unique scrolls with a 'percentage_read' higher than 0.85 for each post
var count_unique = new Keen.Query("count_unique", {
  event_collection: "page_scrolls",
  target_property: "user.uuid",
  timeframe: "this_24_hours",
  group_by: "page.id",
  filters: [
    {
      property_name: "percentage_read",
      operator: "gt",
      property_value: 0.85
    }
  ]
});

// Send query
client.run(count, function(err, count_response){
   client.run(unique_count, function(err, unique_count_response){
      calculateReadPercentages(count_response.result, unique_count_response);
    });
});

calculateReadPercentages() takes the counts from each query and makes a Read Percentage for all the posts using the formula unique_count / count

The results can then be visualized using Keen’s visualization tools.

Content Velocity

The code needed for analyzing content velocity requires a Count Query with a additional interval query parameter:

var content_velocity = new Keen.Query("count", {
  event_collection: "page_views",
  timeframe: "this_2_hours",
  group_by: "page.id",
  interval: "hourly",
});

// Send query
client.run(content_velocity, function(err, response){
  calculateContentVelocities(response.result);
});

This query, when run, retrieves the last two hours of Page Views and groups them by hour and ID.

calculateContentVelocities() is an example function that compares views for each post between hourly groups and returns a Content Velocity for each post.

A high Content Velocity score would be 6.0, a score of 1.0 would indicate a flat growth rate, and a 0.7 score would be a negative growth rate.

Here’s a sample response that shows how the data is sent from Keen:

{
  "result": [
    {
      "value": [
        {
          "page.id": 112,
          "result": 5
        },
        {
          "page.id": 251,
          "result": 5
        }
      ],
      "timeframe": {
        "start": "2016-02-01T16:00:00.000Z",
        "end": "2016-02-01T17:00:00.000Z"
      }
    },
    {
      "value": [
        {
          "page.id": 112,
          "result": 30
        },
        {
          "page.id": 251,
          "result": 5
        }
      ],
      "timeframe": {
        "start": "2016-02-01T17:00:00.000Z",
        "end": "2016-02-02T18:00:00.000Z"
      }
    }
  ]
}

As the sample response shows, the Post 112 had a growth rate of 600% between the two intervals, so its Velocity score would be 6.0 while Post 251 would have a score of 1.0.

Conversion Percentage

A great way to visualize what percentage of users convert on a desired outcome is through a funnel. Keen has built in support for funnels, so making one is simple:

var funnel = new Keen.Query("funnel", {
  steps: [
    {
     event_collection: "page_views",
     actor_property: "user.uuid",
     timeframe: "this_7_days"
    },
    {
     event_collection: "subscribes",
     actor_property: "user.uuid",
     timeframe: "this_7_days"
    }
  ]
});

var getConversionPercentage = function(steps){
    return steps[1] / steps[0];
}

client.run(funnel, function(err, response){
     $("#conversionPercentage").text("Conversion Percentage: " + (getConversionPercentage(response.result) * 100)  + "%");
});

The above code constructs a Funnel Query using the page_views collection and an example subscribes collection that tracks new subscribers.

As explained in more detail here, user.uid is stored in each collection and acts as an actor ID. It’s important to remember that each collection needs a unique ID that represents the same actor across all the steps.

Lastly, when the query runs, it returns an array of numbers that shows how many actors progressed to each step. Then, the values are turned into a percentage and displayed on a dashboard.

Ready to increase content virality?

It’s easy to start measuring the impact of your content. If you’d like to learn more about how to get the most out of your data, reach out to us to schedule a demo and free data consultation.