Expand my Community achievements bar.

Join us January 15th for an AMA with Champion Achaia Walton, who will be talking about her article on Event-Based Reporting and Measuring Content Groups!

What's the exact syntax for populating data layer elements in Adobe Launch using ACDL?

Avatar

Level 1

Simple question for you folks, but I don't get it. It's the first time I am using the event driven approach in Adobe Launch.

I manage to trigger the server call for overlay events, but do not know how to retrieve the values from eventInfo attributes. I tried "event.message.eventInfo.articleName", "adobeDataLayer.eventInfo.articleName", "eventInfo.articleName" but none of these return any value, so I wonder what's the exact syntax to retrieve the values? Do I need to configure anything else in Launch before? I am using version 2.0.2 of the Adobe Client Data Layer.

window.adobeDataLayer.push({

    "event": "overlay",

    "eventInfo": {

        "articleId": "10787",

        "articleName": "Lorem Ipsum",

        "articleDateTime": "4.12.2024",

        "contentType": "news",

        "rating": "25"

    }

});

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

4 Replies

Avatar

Community Advisor

Hi @JudithKo 

Are you using ACDL extension or you're injecting the ACDL file directly? 

here in your case, the approach you tried - 

  • adobeDataLayer.eventInfo.articleName: The adobeDataLayer object contains all pushed data but does not directly expose event-specific attributes like eventInfo.
  • eventInfo.articleName: This alone won't work because it must be accessed via the event object.

So basically, The values in eventInfo are available on the event object passed by the ACDL. Here's how you can access them: 

 

 

window.adobeDataLayer.addEventListener("overlay", function(event) {
    console.log(event.eventInfo.articleName); // Accesses "Lorem Ipsum"
});

 

 

 

In case if you're unsure and facing issues then you can debug through browser console - 

Run console.log(window.adobeDataLayer) in your browser's developer console to verify the structure and content.

Hope this helps. 

 

Avatar

Community Advisor

@JudithKo how and where are you trying to access the eventInfo?


event.message.eventInfo.articleName should work if you are inside of a rule that was triggered by an ACDL event.

 

It's a little annoying that there is no way to create eventInfo-based data elements through the extension whereas accessing the computed state is supported.

Cheers from Switzerland!


Avatar

Community Advisor

Hi @bjoern__koth Thanks, 

so correct me - as per my understanding, event.message alone not work. it should be access like event.message.event or event.message.eventInfo 

but the event.message.event reference to the current active event only right? 

 

Avatar

Community Advisor

event.message.event is the named event attribute that was pushed into the ACDL. In the example, it's "overlay". It's not mandatory to push the "event" attribute.

 

"event" itself refers to the event that triggered the Launch rule that executes. Hence going through the "message" is required.

 

"adobeDataLayer.eventInfo" to my knowledge does not exist.

Cheers from Switzerland!