The Importance of a Comprehensive Hit Detail in Clickstream Analytics

Tom De Moya
Broadlume Product Development
3 min readJul 23, 2021

Let’s start this discussion with the official definition of a Hit from Google.

“A Hit is an interaction that results in data being sent to Analytics.”

As we browse the web, even on this very website, hits are sent to Google Analytics containing a wealth of data about you and the website you are interacting with. Out of the box, Google Analytics sends the type of hit it was (e.g. pageview, event, e-commerce, user timing, and more) and information about your browser, operating system, page, and even screen resolution.

Example of a hit being sent to Google Analytics:

https://www.google-analytics.com/j/collect?v=1&_v=j91&a=189363930&t=pageview&_s=1&dl=https%3A%2F%2Fmedium.com%2Fbroadlume-product%2Fkeeping-your-customers-informed-483aececfb67&ul=en-us&de=UTF-8&dt=Keeping%20Your%20Customers%20Informed.%20How%20we%20used%20Looker%20to%20transform%20our%E2%80%A6%20%7C%20by%20Steven%20McMullen%20%7C%20Broadlume%20Product%20Development%20%7C%20Jun%2C%202021%20%7C%20Medium&sd=24-bit&sr=2560x1080&vp=1074x782&je=0&_u=AACAAEABAAAAAC~&jid=&gjid=&cid=730714530.1623784061&tid=UA-24232453-2&_gid=1759831497.1627060522&_slc=1&z=1826202470

Google Analytics collects these hits at scale and visualizes most of this data in their dashboards for consumption. For many businesses, this is plenty of information about what the user has viewed, where they came from, and what they saw.

But what if an enterprise-level website or collection of websites has deeper questions about their content? Can Google Analytics answer what template the website was on at the time of the pageview? Can your data team easily attribute hundreds of website configurations to millions of user hits across a whole year? This is where expanding on the hit detail comes in.

While there are many ways of attributing details about a website after the hit was made in your data warehouse, a scalable way is via the data layer at the time of collection or hit creation. In short, the concept works in this order:

Example of a Data Layer Push:

<script>

window.dataLayer = window.dataLayer || [];

window.dataLayer.push({

‘event’: ‘Photo Upload’,

‘template’: ‘Holiday’

‘color’: ‘Green’

‘mapOption’: ‘True’

‘clientId’: ‘12345’

});

</script>

  1. Initialize or push data in an array format to the data layer. A push can be done with a simple script like the above one.
  2. Ensure that the hit is fired after the data is available to ensure the end product sees the full hit with all the data meant to be sent.
  3. Send these additional variable values via custom dimensions in the hit detail. This can be detailed manually or if using Google Tag Manager, they can be configured via the Settings Variable for a scalable operation.
  4. Ensure your receiving Universal Google Analytics property has the appropriate custom dimensions that line up with your GTM settings.

In the data layer example above, your data team isn’t just able to quantify how many photo uploads occurred and on what page with what type of device. It will also detail what options did the client have enabled, who was the client, what template did the user see at the time of photo upload, and other data.

As you can start to see, the benefits of this approach are significant.

  1. Transparency. The amount of detail exposed is completely up to your team to decide. Internal and external clients can decide to adopt this approach with the data you exposed.
  2. A Complete Historical Source of Truth. While page views and other hits can be cross-referenced with client data post-hit collection, attaching this wealth of knowledge at the exact time of collection can save you significant effort downstream in your analysis.
  3. Ease of Analysis. Google Analytics is a very well-known and powerful tool. By attaching a template name to hits, an analyst can save significant time by comparing conversion rates and other performance ratios across templates in very little time.

Next Steps:

A fun activity is browsing the web and reading what companies are pushing to the data layer freely. One can learn a lot about enterprise-level implementations by just typing “window.dataLayer” into your Chrome Developer Tools Console. Try it!

AudiSouthBurlington.com

--

--