Google Analytics (Universal) Data Layer Examples
Google Analytics is powerful out of the box, but it’s much more powerful when you begin to send custom events and dimensions based on user activity on your website. ListenLayer automates this by making data available in the data layer.
Important Notice!
While the following examples show actual code, ListenLayer requires no programming experience! We generate the following data layer values automatically so that you can capture them as variables for your conversion tracking - no coding required! Check out our examples and use cases to see how easy it is to implement and scale conversion tracking and web analytics.
Custom Triggers for Event Tracking
ListenLayer automatically generates powerful and accurate events inside the data layer, allowing you to create GTM triggers by simply referencing the event name. Once these triggers are built, simple event tags in GTM can send events and dimensions to Google Analytics.
This example shows events from our Hubspot Forms Listener. Each Listener generates events unique to the application’s functionality.
event: 'hubspotFormSubmitted',
event: 'hubspotFormLoaded',
event: 'hubspotFormValidationFailed',
Automatic Data Layer Values
With each event generated by ListenLayer, we push powerful details about the user’s session and activity into the data layer. These become available as variables inside GTM.
Use these variables to modify triggers in GTM or enhance the data you collect using Google Analytics events and dimensions.
chatAutomaticValues: {
messageFromUserCount: 3,
hsChatType: 'Hubspot Form chat Message from User',
hsChatLocation: {
href: 'https://demo.website.com/',
host: 'demo.website.com',
hostname: 'demo.website.com',
pathname: '/',
protocol: 'https:',
originPathName: 'https://demo.website.com/'
}
}
Custom Data Layer Values in GTM
With our powerful interface, marketers can write rules to generate custom data layer values – no programming required!
Now activity on your website can be categorized and organized exactly how you want it. Push these values into GTM as custom variables and then feed them into Google Analytics.
formCustomValues: {
//custom variable values display here based on rules you write
formCategory: 'Demo',
formName: 'Landing Page Demo Form',
formQuality: 'Low'
},
Ready to Dive In?
See how easy (and powerful) ListenLayer is by opening an account today or requesting a demo.