Implementation Updates Public

Expandable Content Tracking Added to Mason Standard GTM Container

I have added expandable content area tracking to the functionality provided in the Mason Standard GTM container.

If your site uses expandable content areas, you can use this functionality to determine how often people are actually clicking to expand those containers.

Why Track This?

This is helpful for two reasons:

  1. For less-critical content on a page, you can see how often this content is actually viewed by a user when viewing a particular page (to determine if it is really useful content). If you have content on a page that you are not sure is being read by users, putting the content into an expandable content area (that you can track) will give you information about how many users are actually interested in viewing this content.
  2. By putting important content into an expandable area on a landing page, you can get a better idea of bounce rate. For example, if you have a page that people often land on, and then immediately exit from, every visit that doesn’t include a view of another page will count as a bounce. However, by adding tracking of the expandable area interaction, visits which include a view of the expandable area content will no longer count as bounces, giving you a more accurate bounce rate.

How to This Up for Your Website

The Mason Standard GTM container now includes this functionality, although it might have to be customized for your website.

The trigger that detects a click on an expandable content area can be found in the Mason Standard GTM container folder named “00 standard configuration settings”. The trigger is called “click – expandable area”. This trigger uses a CSS selector to detect clicks on elements that represent expandable areas.

  • If you are using the Mason drupal platform, the GTM trigger is already configured appropriately by default.
  • If you are using any other platform, you will have to customize the CSS selector in the trigger to select elements that represent expandable areas on your website.

Custom GA Report

I have created a custom report in GA to display the expandable content area interactions. Click here to import the report into your GA account.

Outstanding Issues

There are a couple outstanding issues with this implementation. Please see the following screenshot as an example:

  • Different browsers will display the title of the expandable content area in different ways. Note how the same headings will be labelled slightly differently (including the “more” or “less” indicator). This is a bit annoying as you may have to add together a few line-items in the report to get the real total of interactions, but is not a critical issue.
  • While the code will try to determine whether the click action was for an open of close of the expandable content area and store that as the event action, it cannot always determine which action was prompted by the click. In these cases, it will use an event action value of “indeterminate”. Since we are less interested in people closing the expandable areas, this is not a big issue.