How to capture data from component state through events using adobe client data layer in adobe launch? | Community
Skip to main content
New Participant
September 5, 2022
Solved

How to capture data from component state through events using adobe client data layer in adobe launch?

  • September 5, 2022
  • 2 replies
  • 2333 views

We have implemented default adobe client data layer and trying to capture click events. Currently we are able to capture only eventinfo like path..etc.

I can see we can capture component data using the path from event info by getting the component full state.

Can anyone suggest how to capture component data by getting full state through events in adobe launch?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by rangavinod

This article have the solution I am looking for and I implemented it successfully- Able to capture the component data via events.

https://experienceleague.adobe.com/docs/experience-manager-learn/sites/integrations/analytics/track-clicked-component.html?lang=en

2 replies

rangavinodAuthorAccepted solution
New Participant
September 7, 2022

This article have the solution I am looking for and I implemented it successfully- Able to capture the component data via events.

https://experienceleague.adobe.com/docs/experience-manager-learn/sites/integrations/analytics/track-clicked-component.html?lang=en

yuhuisg
New Participant
September 5, 2022

I assume that you're referring to the method described at https://experienceleague.adobe.com/docs/experience-manager-learn/sites/integrations/adobe-client-data-layer/data-layer-overview.html?lang=en

Prepare to write custom code, because that is what you need to do to get the data out from that AEM integration. See the "Working with Events" section in that page to see what you need to do.

If you don't like this approach (disclaimer: I don't!), then don't use the AEM integration at all. Instead, work with your developers to push whatever information you need into ACDL based on the user's action. It'll be more work for your developers, but the end result is that you should be able to get your data directly using the ACDL data element type "Get Computed State", which allows you to avoid using custom code.

New Participant
September 6, 2022

@yuhuisg Thanks for your response. Based on the document you provided, I got the point till printing the output in console. Do you know how can we get this output in launch?

 

Like how can we capture the dataObject in Launch that is printed in console? (want to capture this dataObject values in evars using Launch via events)

yuhuisg
New Participant
September 6, 2022

Assuming that your ACDL structure is like the one that is used in the example at that documentation, then the following might work, e.g. with the pageShownHandler() function (note: I haven't tested any of this myself!)

function pageShownHandler(event) {
    var dataObject = getDataObjectHelper(event, {"@type": "wknd/components/page"});
    if(dataObject != null) {
        s.eVarXX = dataObject['dc:title'];  // set the eVar with the "dc:title" value
    }
}