Highlighted

AEM Project Archetype 24 | AEM Community Blog Seeding

kautuk_sahni

Community Manager

27-09-2020

BlogImage.jpg

AEM Project Archetype 24 by Adobe Git

Abstract

Introduction
The Adobe Client Data Layer reduces the effort to instrument websites by providing a standardized method to expose and access any kind of data for any script. It consists of a JavaScript client-side event-driven data store that can be used on web pages:

to collect data about what the visitors experience on the web page;
to communicate this data to digital analytics and reporting servers.
This document focuses on the data layer object API, and not on the data format used to persist the data within the data layer. The data layer imposes no specific data format, but Adobe recommends to use XDM to ease interoperability.

Description
The Adobe Client Data Layer is a JavaScript store for data and events happening on a page within the scope of a request. It provides an API to:
1. Register data that is to be merged into the data layer state.
2. Trigger events that relate to the data stored in the data layer.
3. Get the current data layer state of all merged data.
4. Register listeners that are called for specific events or data changes.
5. List the history of registered data and triggered events.

Architecture
The registration and triggering of events are done by appending the corresponding instructions to a plain JavaScript Array that serves as a queue. This offers multiple benefits:
1. The page and other scripts can start to register data, to trigger events, and to register callbacks by adding them to the array, even before the data layer script itself has been loaded. This allows to load the data layer script asynchronously or deferred, ensuring that it won't affect the page load speed significantly.
2. The data layer array serves as a first-in-first-out queue that avoids racing conditions between scripts and offers at all times the full history of what happened. This allows to easily replay and debug what happened.

Read Full Blog

AEM Project Archetype 24

Q&A

Please use this thread to ask the related questions.

AEM AEMEBlogSeeding Experience Manager