Working on Google Tag Manager, it just feels easy to create simple click events and managing them in conjunction with GA and other tracking services. While there are a million data points that can show you how a customer interacts on your site, there are some data points that can show which categories are performing better than others and which ones get traffic but are not scrolled through the most.

For us to track these data points, we will have to add a few scripts to Google Tag Manager:

  1. Scroll Depth Tracking
  2. Author Name Tracking Javascript
  3. Author or Category page tracking
  4. Event Tracking for Scroll Depth
  5. DuracellTomi’s Google Tag Manager for WordPress

I am going to use a test container here to show you a step by step example of steps, if you are new to Google Tag Manager you can find the downloadable .json file below at the end of this post as well as the javascript that would enable you to track the Author and Category can be found below

  1. Go on, if you already have a gmail account, you can login with that account else you will have to create a new account  and login

2. Setup a container for your site, because we are setting up a container for web we will click on ‘Web’ amd then click on ‘CREATE’

 3. Click on new variable and create a custom javascript variable, copy and paste the author tracking script given below and save the variable name “Auth”



4. Create a GA Variable with the tracking property id provided you by Google Analytics

5. Create another custom javascript variable by the name of “Track Categories or Author”, copy and paste the code provided below and save the variable

6. Click on Admin and then click on Import container

7. Click on Choose container file, save the file given below i.e. Scroll Tracking Container and select it in the file selection dialog

8. Click on existing and then choose merge

9. Once that is done, submit the container (You can either create a container or publish it right away)

Get Post Author Name in WordPress:

    Author Name

Save Category of Author Name as event label:

Script to track category and sub category on a publisher site

Download Scroll Tracking Json file:

Author Scroll Tracking – Usman Farooq

Leave a comment

Your email address will not be published. Required fields are marked *