Step by Step Universal Analytics Tutorial for Bloggers: Track Behavior not Pageviews

Article written by Claudiu Murariu

What data would help you make your blog better? It sure isn’t the number of pageviews!

The old Google Analytics and most other tools as well, focus on tracking pageviews. The new Universal Analytics from Google allows you to define what is important for you and track it.

Ready? Let’s get started. With this tutorial you will learn how to implement advanced web analytics tracking in order to answer questions like:

  • how many people read your articles vs how many people scan them
  • what categories of articles are most valued
  • correlations between the number of words of an article and social media success
  • what are the most successful article titles

No pageviews and no number of visitors? No! Analysts call them vanity metrics: they don’t help your blog and they don’t give you hints on how to optimize it, they just make you feel good.

Image Source: KISSmetrics Blog

Image Source: KISSmetrics Blog

While it helps to have basic coding skills, you won’t need them this time I will share all the codes to be used to get all of the above reports. For this tutorial you will need:

  • Google Analytics account
  • Universal Analytics activated in your Google Analytics account
  • Google Tag Manager
  • WordPress Plugin specially designed for this tutorial

Step1. Universal Analytics

Google Analytics has just made Universal Analytics accessible to everyone as a public beta. You won’t be able to transform your existing reports to Universal Analytics so you’ll need to create an additional account for your website.


KISSmetrics published a great tutorial on how to get started with Universal Tracking. Check it out.

While going through the Custom Dimensions and Metrics setup, make sure to replicate the following dimensions and metrics:



The new account will give you a tracking code. Do not post that tracking code on your WordPress blog. Save it in a file for a later step.

Step 2. Install WordPress plugin

We have developed a WordPress plugin that gathers data about your content and shares it with Google Tag Manager which with the help of the tracking codes shared below will be able to send contextual data about your articles to Google Analytics.


The plugin will allow you to automatically insert the Google Tag Manager script in your WordPress installation and also make available a dataLayer set of contextual data that can be used for tracking contextual data and not just pageviews.

Information from your blog that can be used inside Google Tag Manager:

  • platform (default value: wordpress)
  • website name
  • page type
  • category for articles
  • wordcount for pages and articles
  • article titles

Step 3. Set Google Tag Manager

Create Google Tag Manager account and define a container for your blog. Here is a video tutorial on how to do it:

When you finish with the setup, Google Tag Manager will provide you a JavaScript code that needs to be placed inside the WordPress plugin you just installed at the previous step.


Step 4. Add the Tags in Google Tag Manager

With Google Tag Manager you get to define different tracking codes for each page or group of pages on your blog which allows advanced customizations of the data that is sent to Google Analytics. Basically you won’t send only the URL of the page a person is visiting but much more contextual data next to it.

In the end, your Google tag Manager setup will look something like this:


First, we need to initialize the Google Analytics tracking code, the one from step 1 that you saved for later use.

Create a new tag, name it Google Analytics Init, select the type Custom HTML and make it run on All Pages via the rules section. The code of the tag should look like this:

The tag will end up looking like this:


The second step is to read the data inside Google Tag Manager from the WordPress plugin we installed at step 2. This is done though Macros.

You need to define a macro for each info that is send from the plugin. Here is how a Macro setup looks like:



Make sure to define all the following Macros (use the values for both the Macro Name and the the Data Layer Variable Name field):

  • pageName
  • postCategory
  • wordCount
  • postType
  • postTitle
  • archiveCategory

Now let’s create a tag that send all that data to Google Analytics through custom dimensions and custom metrics.

The code for the tag:

The rule for the tag:

used value: {{event}} contains trackingLoaded

used value: {{event}} contains trackingLoaded

The next step is to track the reading behavior or articles. Create a new tag for that called Reader vs Scanner Behavior Tag. The code for this tag:

The rules for this tag:


Step 5. View the new reports

While Universal Analytics reports are not available out of the box, you can create Custom Reports based on the newly collected data. Here’s how:

Here is a sample report on how many of visitors are reading articles vs how many are scanning them:


Ask yourself the following question: What data would help me make my blog better?

Step 6: Challenge me!

The above setup can accommodate pretty much any report needs for your blog. Challenge me with what reports you believe can really help your blog and I’ll dedicate a whole article on how to generate them.

Send me your requests via Twitter or simply use the below comment area and I’ll promise to cover them in a dedicated article. If I won’t know how to answer, I’ll find someone who will.

Step by Step Universal Analytics Tutorial for Bloggers: Track Behavior not Pageviews by

1.100.000+ email leads collected with

PadiAct helps you get more email leads. More and better.

  • Pingback: Marketing Day: April 12, 2013

  • getoptimise

    To recap, we have here

    1. Reader vs Scanner Behavior Tag,
    2. Track Pages Tag (pageName, postCategory, wordCount, postType, postTitle, archiveCategory),
    3. Google Analytics Init Tag

    For each of these tags, they have their own rules?

    Am I correct? Many Thanks

    • cllaudiu

      Yes, you are correct. Each tag comes with its own set of rules.
      Each tag also contains a special event trigger which helps set the order of which tag is fired first.

  • Damion Brown

    Thanks for this Claudiu! And apologies for what much look like crazy behaviour moving up and down this page as I implemented everything :)

    I wonder if it would be possible to create another trigger when someone spends more than 20 minutes on a page and scrolls up and down a lot — it might trigger “confused visitor” maybe?

    Some information-dense sites use pages per visit as an indication of how lost their users are on the site. For example, a government site here in Australia plots the number of pages navigated before a user downloads the right tax PDF. If the number of pageviews is higher than 5, they figure that the PDF is in the wrong place and try to find a better place for it within the information architecture.

    Surely there would be some pretty neat ways of using Universal Analytics to build up a picture of “confused” or “lost users” … what do you think?

    • cllaudiu

      Hi Damion,

      Yes, you could play with triggers though with more complex behaviors it gets tricky.
      For example, a person who wants to understand every bit of info you have or a person that does detailed research might have the same behavior you describe and not be confused.

      What I would do is not to tag those people as confused but rather as highly engaged behavior. If their number is big then I might just ask them what holds them on the website.

      If they say they are confused, you have a problem. If they say they love what you have and want to understand every bit of information then you are happy.

  • Pingback: Digital Analytics Week In Review - 19 April 2013 - Data Runs Deep