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: "",
      tld: "",
      hostname: "",
      pathname: "/",
      queryString: "?parameter1=2&parameter2=3",
      parameters: {parameter1: 2, parameter2: 3},
      fragment: null,
      protocol: "https",
      originPathName: ""
    clickText: "",
    clickTarget: "_blank",
    clickID: "google-link",
    clickClasses: "link-class",
    clickElement: "html >" +
                  "mmerce-js > main > div.container > div.container > ul > li >" +
    clickLocation: {
      url: "",
      tld: "",
      hostname: "",
      pathname: "/click-links/",
      queryString: null,
      fragment: null,
      protocol: "https",
      originPathName: ""

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"