adobe / reactor-extension-googledatalayer

Extension for Adobe Experience Platform Tags that enables management of a Google data layer.
https://experienceleague.adobe.com/docs/experience-platform/tags/extensions/adobe/google-data-layer/overview.html
Apache License 2.0
4 stars 5 forks source link
adobe extension google launch

Google Data Layer extension for Adobe Experience Platform Tags

Overview

This extension allows Adobe Experience Platform Tags (fka Launch) to use a Google data layer, either independently or simultaneously with Google solutions, and using the same logic; Google's open source Data Layer Helper library. The Helper library provides similar Event Driven functionality to the Adobe Client Data Dayer (ACDL). The data elements, rules and actions of the extension provide similar functionality to those in the ACDL extension.

Use Case

The Google data layer extension is intended to support the use case of Google and Adobe data consumers on the same web page and provide both with a single source of data truth. The following scenarios may result in this:

Compatibility with AEP / XDM

The extension is fully compatible with a Platform Web SDK / XDM implementation, as XDM mapping is not affected by the choice of data layer. The extension was originally developed to support adoption of Web SDK in a primarily Google environment.

Simultaneous Data Layer Access Risk

The extension does not change the data layer unless a push is made, nor interact with other Helper objects (such as the internal GTM Helper). The Helper object used by launch to monitor the data layer for changes is separate from other Helpers accessing the data layer, and maintains and operates on an internal model of the data layer; so an event on the data layer is caught and processed independently in each Helper object. An example of this is seen when the history of past data layer events is processed - each Helper maintains its own history.

Event Integrity

A key function of an Event Driven Data Layer (EDDL) is to allow stable-state 'snapshots' of the data layer to be processed independently of ongoing data layer activity. To achieve this the GDL Helper object maintains the data layer computed state (an internal model of the data layer) and passes a copy of this state to a Tags rule whenever the data layer state changes (a push event); so allowing Tags to process the event-specific 'snapshot' in a Rule. This functionality ensures that multiple rapid events do not conflict during near simultaneous writing to the data layer, as they could if code accessed the data layer directly.

The Tags extension data elements and related actions do make use of the stable model of the data layer whenever the extension event dialog is used to configure a data layer listener.

Use of Data Elements and Actions in General Tags Rules

When Tags rules fire on events that are not related to the data layer such as Library Loaded, the actions and data elements of the GDL extension are still available and function in the same way, but return values from the data layer computed state at the time of rule execution.

Event History

When the data layer extension is loaded in the page, any previous data layer events will be processed, this avoiding the issue of missed events resulting from load order; particularly a concern in asynchronous load scenarios.

Capabilties

The data extension provides:

More information

This Adobe Tech Blog article looks in detail and the EDDL functionality, use cases and deployment of the Adobe Google Data Layer extension.

The extension rule event and data element dialogs themselves contain detail about the use of each.

Source Projects

This project uses code from the following projects:

Google Helper project

ACDL Extension

Development

To start the Launch Sandbox and build the software, clone then repo, install node/npm if necessary, then run the rollowing in the project root:

npm install

npm run sandbox

For other npm scripts see the package.json

Contribution

We welcome contributions! Please see the included contribution page.