PDF & Document Click Data Layer Examples
Learn more about how ListenLayer generates powerful data layers from the activity on your website, specifically from PDF & Document Clicks.
Custom Data Layer Events
The PDF & Document Clicks Listener automatically pushes detailed information into the data layer when user’s click on document links on your website. This begins by sending the event ‘documentLinkClick’ into the data layer so you can easily identify the click activity and target it using triggers in Google Tag Manager.
event: 'documentLinkClick'
Automatic Data Layer Values
When a document 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, class, file name, file extension, and full URL
- The xPath location of the click on the page
- Detail about the URL the user clicked to, including a parsed set of URL parameters
- Detailed timestamp information for the event
clickAutomaticValues: {
documentURL: {
url: "http://www.africau.edu/images/default/sample.pdf?test=dasdas",
tld: "africau.edu",
hostname: "www.africau.edu",
pathname: "/images/default/sample.pdf",
queryString: "?test=dasdas",
parameters: {test: "dasdas"},
fragment: null,
protocol: "http",
originPathName: "http://www.africau.edu/images/default/sample.pdf",
fileName: "sample.pdf",
fileExtension: ".pdf"
},
clickText: "sample pdf",
clickTarget: "_blank",
clickID: "sample",
clickClasses: "pdf-class",
clickElement: "html > body.page-template-default.page.page-id-265.theme-screen1template.wooco" +
"mmerce-js > main > div.container > div.container > ul > li > a.pdf-class#sample",
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/"
},
eventTimestamp: {
userTime: {
timezone: {
fullTimezone: "UTC-07:00(America/Denver)",
timezoneName: "America/Denver",
utcOffsetHours: -7,
utcOffsetSeconds: -25200,
observingDST: 0
},
time: {
epoch: 1642970398,
iso8601: "2022-01-23T13:39:58.901Z",
fullTimestamp: "Sun Jan 23 2022 13:39:58 UTC-0700 (America/Denver)",
date: "2022-01-23",
dateString: "Jan 23 2022",
dayOfWeek: "Sun",
timeOfDay: "13:39:58"
}
},
utcTime: {
time: {
epoch: 1642995598,
iso8601: "2022-01-23T20:39:58.901Z",
fullTimestamp: "Sun Jan 23 2022 20:39:58 UTC",
date: "2022-01-23",
dateString: "Jan 23 2022",
dayOfWeek: "Sun",
timeOfDay: "20:39:58"
}
},
listenlayerAccountTime: {
timezone: {
fullTimezone: "UTC-07:00(America/Denver)",
timezoneName: "America/Denver",
utcOffsetHours: -7,
utcOffsetSeconds: -25200
},
time: {
epoch: 1642970398,
iso8601: "2022-01-23T13:39:58.000Z",
fullTimestamp: "Sun Jan 23 2022 13:39:58 UTC-0700 (America/Denver)",
date: "2022-01-23",
dateString: "Jan 23 2022",
dayOfWeek: "Sun",
timeOfDay: "13:39:58"
}
}
}
}
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 document links based on their location or other characteristics of the click or file itself.
In this example, we have categorized our document clicks based on the file name. We’ve pushed documentCategory: “eBooks” into the data layer as a variable that we can now capture in Google Tag Manager. We can send this data to our analytics platforms to segment or aggregate data for better insights. The rules for custom data layer values 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
documentCategory: "eBooks"
}
Ready to Dive In?
See how easy (and powerful) ListenLayer is by opening an account today or requesting a demo.