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.
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:
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):
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:
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.