The EDDL Helper Extension is a simple tool to help manage an event driven data layer in Adobe Launch.
What is an Event Driven Data Layer?
An event driven data layer often refers to a tag manager implementation built around a JavaScript array object, which is populated when events happen on a website. The array can be populated with the .push({}) method containing relevant event data in JSON format. That push event can then trigger rules and actions, such as sending an analytics beacon or firing a marketing pixel.
The concept of an event driven data layer is gaining popularity because it’s flexible, easy to communicate, and it separates website code from tag management and analytics tools. The data layer can be maintained and structured independently of marketing technology deployed on the site.
EDDL Helper Extension
The EDDL Helper extension is designed to make it easy to use an event array data layer with Adobe Launch. The extension lets you define your data layer object (you can use an existing object) and then respond to a certain key value pair by firing direct call rules. The default data layer name is “dataLayer” and the default direct call rule identifier is the “event” key. This means that a dataLayer.push({"event":"test"});
would fire the “test” direct call rule. The data that is passed with the push event is merged into a “computed state” which is made available through data elements by the extension. You can also access the push event data directly with “event.detail” inside the direct call rule in Launch.
The extension uses direct call rules to avoid adding bloat to your site, and because they widely used, easy to set up, and would allow you to stop using this extension without a big migration effort if you chose.
Extension Set Up
Setting up the EDDL Helper is easy. The options are explained in more detail below.
Step 1 – Main Settings
The main settings let you choose a data layer name as well as a direct call rule identifier. You can enable or disable direct call rules too.
Data Layer Name
The data layer name field is to define the array object which will be your data layer. You can even choose an object which is not on the site yet, and this extension will create it for you.
Fire Direct Call Rules
If you enable this checkbox then the direct call rule identifier you choose will be used to fire direct call rules.
Direct Call Rule Identifier
When you enable direct call rules you get to choose the identifier key which will be used to fire direct call rules. The default is the event key. This means that when an object is pushed into your data layer with an “event” property, the value of the “event” property is used to fire a direct call rule. This is how you use push events to control Launch rules and trigger conditions and actions.
Step 2 – Advanced Settings (Optional)
In the advanced settings you can control how arrays are handled within the merged / computed state of your data layer.
Data Layer Helper Name
The extension works by creating a secondary object called the data layer helper object. This object stores the history of the data layer and manages the merged / computed state of the data layer too. You can define the name here if you choose.
Array Settings
This is a very important setting if you want to change the way that arrays are merged into your data layer state. The default behavior is similar to the Google Data Layer and the Adobe Client Data Layer in that arrays pushed into arrays are merged with the index value of each item. You can choose to change this to “clear arrays” which will instead overwrite the entire array with the new array items on each push event. See examples below.
Example of Merged Array
dataLayer.push({"array": [1,2,3,4,5]});
dataLayer.push({"array": [6,7]});
// result: {"array": [6,7,3,4,5]}
Example of Cleared Array
dataLayer.push({"array": [1,2,3,4,5]});
dataLayer.push({"array": [6,7]});
// result: {"array": [6,7]}
Step 3 – Load The Extension
You will need to load the extension on your site with a Launch rule. It’s recommenced to use a “Library Loaded (Page Top)” rule here. The extension provides an action called “Set Up EDDL Helper” which should fire on this rule. This step is required as this action is what sets up the extension to fire your direct call rules. When this action runs all of the past push events will fire as direct call rules in order, and then any future push events will fire direct call rules straight away.
Step 4 – You’re Done, Use Your Data Layer
You can now set up your direct call rules and use your data layer.
For extra details check out this blog post I wrote after testing the extension on my own site.