Data Layer Examples for Internal Clicks

ListenLayer automatically identifies internal link clicks and pushes them into the data layer, along with detailed characteristics from each click. Check out the data layer samples below and get started for free.

Internal Click Data Layer Examples

Learn more about how ListenLayer generates powerful data layers from the activity on your website, specifically from Internal Clicks.

Custom Data Layer Events

The Internal Clicks Listener automatically pushes detailed information into the data layer when user’s click internal links on your website. This begins by sending the event ‘internalLinkClick’ into the data layer so you can easily identify the click activity and target it using triggers in Google Tag Manager.

event: 'internalLinkClick'

Automatic Data Layer Values

When an Internal Link Click is heard, ListenLayer pushes all of the details about that click into a section of the data layer called “clickAutomaticValues.”

This includes information such as

  • The location of the click on your website in various forms of detail
  • Characteristics of the clicked elements, such as its text, target, CSS ID, and class
  • The xPath location of the click on the page
  • Detail about the URL the user clicked to, including a parsed set of URL parameters
  • Event timestamps in various formats and timezones based on settings inside your ListenLayer account
  clickAutomaticValues: {
    clickURL: {
      url: "https://demo.hostedstaging.com/",
      tld: "hostedstaging.com",
      hostname: "demo.hostedstaging.com",
      pathname: "/",
      queryString: null,
      fragment: null,
      protocol: "https",
      originPathName: "https://demo.hostedstaging.com/"
    },
    clickText: "Screen One",
    clickTarget: "",
    clickID: "",
    clickClasses: "logo",
    clickElement: "html > body.home.page-template-default.page.page-id-9.theme-screen1template.wo" +
                  "ocommerce-js > header > div.container > div.header > a.logo",
    clickLocation: {
      url: "https://demo.hostedstaging.com/?gtm_debug=1642994207318",
      tld: "hostedstaging.com",
      hostname: "demo.hostedstaging.com",
      pathname: "/",
      queryString: "?gtm_debug=1642994207318",
      parameters: {gtm_debug: 1642994207318},
      fragment: null,
      protocol: "https",
      originPathName: "https://demo.hostedstaging.com/"
    },
    eventTimestamp: {
      userTime: {
        timezone: {
          fullTimezone: "UTC-07:00(America/Denver)",
          timezoneName: "America/Denver",
          utcOffsetHours: -7,
          utcOffsetSeconds: -25200,
          observingDST: 0
        },
        time: {
          epoch: 1642994213,
          iso8601: "2022-01-23T20:16:53.594Z",
          fullTimestamp: "Sun Jan 23 2022 20:16:53 UTC-0700 (America/Denver)",
          date: "2022-01-23",
          dateString: "Jan 23 2022",
          dayOfWeek: "Sun",
          timeOfDay: "20:16:53"
        }
      },
      utcTime: {
        time: {
          epoch: 1643019413,
          iso8601: "2022-01-24T03:16:53.594Z",
          fullTimestamp: "Mon Jan 24 2022 03:16:53 UTC",
          date: "2022-01-24",
          dateString: "Jan 24 2022",
          dayOfWeek: "Mon",
          timeOfDay: "03:16:53"
        }
      },
      listenlayerAccountTime: {
        timezone: {
          fullTimezone: "UTC-07:00(America/Denver)",
          timezoneName: "America/Denver",
          utcOffsetHours: -7,
          utcOffsetSeconds: -25200
        },
        time: {
          epoch: 1642994213,
          iso8601: "2022-01-23T20:16:53.000Z",
          fullTimestamp: "Sun Jan 23 2022 20:16:53 UTC-0700 (America/Denver)",
          date: "2022-01-23",
          dateString: "Jan 23 2022",
          dayOfWeek: "Sun",
          timeOfDay: "20:16:53"
        }
      }
    }
  }

Custom Data Layer Values & Browser Storage

ListenLayer allows you to write powerful rules to push custom values into your data layer based on the user’s actions and characteristics. For example, you could categorize your Internal Links based on their location or other characteristics of the click itself.

In this example, we have categorized our internal link clicks based on their characteristics. We can send this variable into our analytics platforms to segment or aggregate data for better insights. The rules are managed in ListenLayer – and you can even write monitoring rules to make sure they never break!

clickCustomValues: {
//custom values from your rules appear here
   clickType: "Secondary CTA"
}