Data Layer Examples for Outbound Clicks

ListenLayer automatically identifies outbound 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.

Outbound Click Data Layer Examples

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

Custom Data Layer Events

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

event: "outboundClick"

Automatic Data Layer Values

When an Outbound 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
clickAutomaticValues: {
    clickURL: {
      url: "https://google.com/?parameter1=2&parameter2=3",
      tld: "google.com",
      hostname: "google.com",
      pathname: "/",
      queryString: "?parameter1=2&parameter2=3",
      parameters: {parameter1: 2, parameter2: 3},
      fragment: null,
      protocol: "https",
      originPathName: "https://google.com/"
    },
    clickText: "google.com",
    clickTarget: "_blank",
    clickID: "google-link",
    clickClasses: "link-class",
    clickElement: "html > body.page-template-default.page.page-id-265.theme-screen1template.wooco" +
                  "mmerce-js > main > div.container > div.container > ul > li > a.link-class#goog" +
                  "le-link",
    clickLocation: {
      url: "https://demo.hostedstaging.com/click-links/",
      tld: "hostedstaging.com",
      hostname: "demo.hostedstaging.com",
      pathname: "/click-links/",
      queryString: null,
      fragment: null,
      protocol: "https",
      originPathName: "https://demo.hostedstaging.com/click-links/"
    }

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 Outbound Links based on their location or other characteristics of the click itself.

In this example, we have categorized our external affiliate clicks based on the product category in the example here. We can send this data to 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
   affiliateCategory: "clothing"
}