Analytical Insights for Virtual Page Views

The more I use a Tag Management System (TMS) for tracking and defining analytical insights from digital advertising results the more I value the application. This growing love affair is enhanced even more for me when combined with the use of my data management tools. Google analytics and Site Catalyst can take you a long way in simple website analysis, but when you want to drill down to discover how to make more from what your digital advertising is doing, or to discover what you’re missing, you need better data management tools. In this case study I have a local real estate client with a website that provides users with information about select neighborhoods in the nations 11th largest city. The website developer used virtual pages for each information article in each neighborhood. There are five virtual pages included in each neighborhood, each of them have the same trigger/name. That makes analytical insights a little easier for tracking events, but I cannot rely on page views in Google Analytics (GA) or from Site Catalyst as the KPI. Instead I’ll have to write a custom javascript that calculates the depth of a page and then tracks the scrolling depth to trigger the virtual page views.

Analytical Insights for Virtual Page Views

After creating the script and installing all of the tracking through the tag management system, I can use Google Analytics and the Real Time menu option to view the events. This view provides at-a-glance analytical insights to what users are currently up-to on the site.
Real time event trackin

I’m trying to develop insights for virtual page views to help sales convince the advertisers to want their ads placed on this real estate website. A key to the insights of the website is in the Neighborhoods section. I want advertisers to place their ads at the top of these pages for a premium rate, mid-page for a little less of a premium charge and at the bottom for the lowest advertising cost. Site visitors scroll the neighborhood pages to read relevant information about the specific neighborhood they are interested in. If I drill down on the GA Real Time events I can see exactly what information (virtual page articles) the user’s are reading over the last 30 minutes.

Virtual pages with real time tracking

The event labels tell the story about the user’s scrolling and that translates to how far down the page they scroll. As you may be able to surmise from looking at the table and graph above, the further down the page an article is, the fewer views it received.

For deeper analytical insights I want to discover more than just the obvious, “what virtual pages were viewed; how far did the user scroll down the page.” Selling advertisers on the value of their ad position should be easy enough with just simple scroll tracking, but with this custom scroll tracking script I can discover more than simple virtual-page-view metrics.

What we can know, and learn from the user’s scrolling behavior:

  • Does scroll depth correlate to conversion rate?
  • How much time was spent scrolling from section to section?
  • If a user clicks to the neighborhood landing page what percentage of the page did they view?
  • What percentage of users click the call-to-action at the bottom of the page?
  • What testing can be done to increase scrolling depth?

Using my data management tools (anlyticsAndDataScience.com) I can build a custom analysis table for discovering insights to each of these questions. Once I build the custom analysis data with the kpi collectors in the columns, it’s a simple matter of filtering the landing page for ‘/neighborhoods’ so the view data is precisely at the granular level I’m analyzing.

Custom analysis scroll tracking table

Developing the virtual page view tracking.

Within the script I have the opportunity to define the scroll depth by percentages. For this example there are five segments to the page (options.percentage ) so I’m tracking by quintile: 20%, 40%, 60%, 80%, and 100%. In the script I will set the page depth to identify the first virtual page read at 20%. Here’s what I have for tracking triggers:

Any landing page in the ‘/neighborhoods/’ file of the website will fire the scroll-tracking-listener. The list of virtual page names in the neighborhoods are:

Housing = Fires at 20% page view

The Market = Fires at 40% page view

Living Here = Fires at 60% page view

Things to Do = Fires at 80% page view

Stats and Facts = Fires at 100% page view

To build these tracking events into the TMS I need to define four custom variables as shown below.

User defined custom variablesEach of these four variables are a Data Layer Variables and you will follow these five steps to create each one.

  1. Name the Variable (eventAction, eventCategory, eventLable, and eventValue)
  2. Select the Data Layer as the variable type.
  3. Define the Data Layer Variable Name (eventAction, eventCategory, eventLable, and eventValue)
  4. Select Version 2 for the version.
  5. Save the variable

Creating custom variablesOnce the custom variables have been created it’s time to set the triggers for the scroll tracking. For this real estate case study I only want to track page depth so I’m going to create two triggers. First I’ll set the Scroll tracker to fire on any page in the ‘/neighborhoods’ folder of the website. Second I will exclude the pixel depth tracking that is defined in the custom script that I’ll get to in just a few minutes.

Create a Page View event:

  1. Name the trigger, Scroll Tracker
  2. Set the trigger type to ‘Page View.’
  3. Define the trigger to fire on a Page URL that contains the web site folder.
  4. Save the trigger

Create the pixel depth filter:

  1. Name the trigger, “Scroll Distance.”
  2. Set this to a ‘Custom Event’ trigger
  3. Fire on the ScrollDistance event name
  4. Set the eventAction to not contain Pixel Depth
  5. Save the trigger

Filtering the events

The only thing left to do is the creation of the tracking Tags. I want to track these events in Google Analytics (GA) so I will create one Tag to send the custom variable data to GA. I will set the calculations and data layer information in a custom HTML tag with a java script.


Setting the GA Scroll Depth tracking:

  1. Name the GA Tag “Scroll Depth”
  2. Choose Universal Analytics as the Tag Type
  3. Select track type to ‘Event’
  4. Set the category, Action, Label, and Value to the custom variables created earlier.
  5. Set the Fire On to the “Scroll Distance” trigger created earlier
  6. Save the TagSend the data layer to Google Analytics



All that’s needed now is the Tag containing the custom java.

You can get the scroll tracking script here.

Create the TAG for a custom HTML and paste the script.paste the custom script to an html tag













  1. Name the Tag “Scroll Tracker”
  2. Select the Custom Html product
  3. Paste the scroll tracker script into the html
  4. Select the Scroll Tracker trigger created earlier
  5. Save the TAG

Last Updated BY: on .

Leave a Comment

Filed under Data Science

Comments are closed.