This document shows you how to use the data layer (
window.dataLayer) to collect product and visitor data from a site.
Implementing data tracking with
window.dataLayer is an alternative to Frosmo developers implementing the tracking in the Frosmo custom script.
What is the data layer?
You can use the data layer to:
- Collect product data from the site through product tracking.
- Collect visitor data from the site through conversion, custom action, product, and transaction tracking.
The following figure shows you where the data layer fits in the Frosmo Platform architecture. For more information about the architecture, see Technical overview. Google Analytics is only involved if your site uses Google Tag Manager.
Figure: Data layer in the Frosmo Platform
Why use the data layer?
You want to send data from your web page to the Frosmo back end. The data may or may not be part of the DOM. The data may be scattered across the page content in HTML elements, it may be metadata stored in the page header, or it may be session data about the visitor. Reading the data from the page would require dedicated solutions for the different pieces. Moreover, if the data structures on the web page change, the solutions are rendered unreliable or obsolete.
Where to go next
Learn how to enable and disable the data layer module for a site. To use the data layer with the Frosmo Platform, the data layer module must be enabled for the site.
Learn the basics of using the data layer to track data on a site.
Learn how to monitor the data layer for data pushes by tracking data layer events.
Learn how to track specific data with the data layer: