To see what Databox can do for you, including how it helps you track and visualize your performance data in real-time, check out our home page. Click here.
If you use Google Analytics to measure your content marketing, you have probably noticed that it does not offer two valuable dimensions for analyzing your data.
First, Google Analytics does not let you review the top-performing authors on your blog.
Even if you use a system like HubSpot, you can only measure sessions, conversions and conversion rate. You do not get any other quality metrics like bounce rate or time on page.
Second, Google Analytics does not show the publish dates of each page. So, if you want to see how your most recent blog posts are performing, you need to search for each one by title or URL. You can’t even do it in a custom report!
So, I wanted to find an automatic way to track the author and publish date of every post, so that you can use those dimensions alongside all metrics within Google Analytics- pageviews, time on page, bounce rate etc.
As long as you have Google Tag Manager set up on your domain, you can actually do this pretty easily. I will show you how to create custom variables in Google Tag Manager that can be loaded up into Google Analytics as custom dimensions.
At the end, you will be able to run any report in Google Analytics (or Databox) with author and publish date dimensions.
Image Credit- Branded3
Google Tag Manager (GTM) is a single code that allows you to quickly update all the third party HTML tags that you add to your website. Since it is an online interface (tagmanager.google.com), any team member can use it to update HTML codes, instead of waiting on a developer. If you plan to use other technologies within your site, like Hotjar or Drift, you should definitely set it up to make it easier to manage tags.
As an example, let’s say that you want to add Drift, a chatbot for marketers and salespeople, to your site. Without GTM, you would need to manually update each Google Analytics tracking code in order to track data on user interaction.
This tutorial is going to cover both WordPress and HubSpot users, so here are two quick guides to installing GTM, if you have not already.
Use the GTM for WordPress plugin to add GTM to your WordPress site and manage it from the WordPress interface.
If you use HubSpot, check out their guide to adding GTM to HubSpot.
We need to do five things in order to get the name of the author into Google Analytics.
Yes, those are slightly out of order compared to the diagram above, but that is the easiest way to create the path from beginning to end.
Struggling to track the impact of your content across platforms? We feel you. Thanks to Databox, fragmented data doesn’t have to hold you back anymore.
Our library of free content marketing dashboard templates puts all the insights and metrics you need in one place. No more jumping between reports!
Measure engagement: Track key metrics like likes, comments, shares across social media platforms to see what content resonates most with your audience. Analyze website traffic, bounce rate, and average time on page to understand how visitors interact with your content.
Optimize conversions: Identify high-performing landing pages and blog posts that drive the most leads using dashboards like HubSpot Marketing Lead Source. Analyze campaign performance and user activity for both organic and paid content with a Facebook Pages & Facebook Ads dashboard.
Improve SEO: See which pages rank highest in search results and drive the most organic traffic. Improve search visibility by visualizing key SEO factors like backlinks and domain rank.
You can easily set it up in just a few clicks – no coding required.
To set up a dashboard, follow these 3 simple steps:
Step 1: Choose a fitting template
Step 2: Connect your data
Step 3: Watch your dashboard populate in seconds
You must be an account “administrator” to create custom dimensions in your account. From the main Google Analytics interface, click the “Admin” button. Select the appropriate Property, and click the Custom Definitions menu item. Then, click Custom Dimensions.Create a new Custom Dimension named “Author” with a scope of “hit” and the Active checkmark box completed.This should be your first custom dimension, so the index will be 1. You can confirm by looking at the JavaScript code snippet.
This is the endpoint where you can eventually access the data in Google Analytics.
If you use HubSpot, skip ahead to the next section. If you use WordPress, check out the “Settings” page for your GTM for WordPress plugin. Make sure the “Post Author name” checkbox is checked.That means that the author name will be available as part of the dataLayer object. You can make sure it is working by opening up the inspector in your browser, clicking into the “Console” tab, and typing “dataLayer”. You should see an array of objects with data like this:In this case, the author data has a label of “pagePostAuthor”. Now, you need to sync that information with Google Tag Manager. Log into Google Tag Manager, and click the “Variables” section on the left.Create a new “User-Defined Variable” at the bottom of the page, and make it a “Data-Layer Variable”. Give it a name of Author”. The data layer variable name must be the exact same as the label above, so in this case, that means that it is “pagePostAuthor”.Skip down to “Connecting a User-Defined Variable to a Custom Dimension” to finish the process.
In HubSpot, the author data is usually stored as a meta tag, so there is no need to add a plugin or integration. Click into any blog on your domain, and open up the inspector. Look within the “head” section of the HTML, and you should find a meta tag with the name of “author”.This is the data you will import into Google Tag Manager.
Log into Google Tag Manager, and click the “Variables” section on the left.Create a new “User-Defined Variable” at the bottom of the page, and make it a “JavaScript Variable”. Give it a name of Author”. The JavaScript variable name must access the meta tag above, which can be done with the following bit of JavaScript:
Here is the last part. We need to connect the data in this user-defined variable to the correct custom dimension in Google Analytics. Click on the “Tags” menu on the left, and find the tag with your Google Analytics tracking code that fires on every page. It should have a “Type” of “Universal Analytics”.
From there, find the “More Settings” dropdown, then the “Custom Dimensions” dropdown under that.Add an Index of 1 to match the index you previously set up in Google Analytics. Then, select the block on the far right, and select the User-Defined Variable you set up previously.
To begin adding the author data to Google Analytics, click “Submit” in the top right.After that, Google Analytics will track the author on every page view, and allow you to track your top authors on an ongoing basis.
We must create a number to represent each date so that we can easily categorize our posts by publish date. In other words, we don’t want to use words like “March 15, 2018”, but instead, we should use “20180315”. This will make it easier to sort the posts using regular expressions.
As you can see from the dataLayer object below, each of those numerical dates is available as a separate property. So, just like above, we are going to import each one into Tag Manager, and combine them into one custom dimension.
You will want to create a new custom dimension called “PublishDate” in the second dimension slot (this will happen by default).
Before we create a date by combining the three properties, we need to create a user-defined variable for each one to get them into Tag Manager. Each one is a Data Layer Variable.
PublishYear stores the year.
PublishMonth stores the month.
PublishDay stores the day.
From there, find the “More Settings” dropdown, then the “Custom Dimensions” dropdown under that.
As you can see above, we add all three variables into one string using double brackets. There should not be any spaces between the variables. This will create one complete date.
Since the title tag is a universal HTML tag, we can pull it into the Google Analytics in the same way across all CMS systems. The steps are very similar to the ones above.
You can find your page title by opening the inspector on any blog post, then looking for the head section within the HTML. You can find the title within the head section.
Create a new custom dimension with the same process as you used above. Except this time, call the dimension “PostTitle”, and attach it to the third custom dimension
Follow the same steps as above to create a user-defined variable within Google Tag Manager. Call this one PostTitle as well, and attach it to document.title as a JavaScript variable to pull in the page title.
From there, find the “More Settings” dropdown, then the “Custom Dimensions” dropdown under that.Add an Index of 3 to match the index you previously set up in Google Analytics. Then, select the block on the far right, and select the User-Defined Variable you set up previously for the page title.
To begin adding the page title data to Google Analytics, click “Submit” in the top right.After that, Google Analytics will track the page title on every page view, and allow you to track your top posts labeled by title on an ongoing basis.
The dashboard pulls custom dimensions 1, 2 and 3 from your Google Analytics account, so if you used those three slots for author, publish date and page title, the data will immediately populate.
It shows your top blog authors based on all posts published in their name, so your team can get competitive over the data for the month or year.
It also looks at pageviews and bounce rate for all your latest posts, so you can see which recent posts are the highest quality, and which ones are helping you hit the month’s traffic goals.
If there are any other custom dimensions that you would like to track, let me know in the comments. I am curious to learn about the other ways that content marketers analyze their content.
Are you maximizing your business potential? Stop guessing and start comparing with companies like yours.
At Databox, we’re obsessed with helping companies more easily monitor, analyze, and report their results. Whether it’s the resources we put into building and maintaining integrations with 100+ popular marketing tools, enabling customizability of charts, dashboards, and reports, or building functionality to make analysis, benchmarking, and forecasting easier, we’re constantly trying to find ways to help our customers save time and deliver better results.
Hey, we’re Databox.Our mission is to help businesses save time and grow faster. Click here to see our platform in action.
Tamara Omerovic is a marketing consultant with 8 years of experience in content marketing and SEO. She specializes in leading high-performing teams and developing effective marketing processes for B2B SaaS brands.
Get practical strategies that drive consistent growth