Expand my Community achievements bar.

Using AEM's core components implementation of adobe client data layer in Launch


Level 1



Let me preface that I am new to Launch so bear with me. I am looking at setting up a site using Adobe's core components version 2.10.0 for AEM, which implements Adobe client data layer and connecting this with adobe analytics using launch, as is standard. Now the core components implements this by defining a schema that looks like this, for their page object:


id: {
    xdm:tags            // page tags
    repo:path           // page path
    xdm:template        // page template
    xdm:language        // page language



And more specifically, the page object would look something like this in the real world, in its computed state:



"page": {
    "page-df1699a779": {
      "xdm:tags": [],
      "xdm:language": "en-GB",
      "xdm:template": "/conf/core-components-examples/settings/wcm/templates/content-page",
      "repo:path": "/content/core-components-examples/library/page-authoring/title.html",
      "dc:title": "Title",
      "@type": "core-components-examples/components/page",
      "repo:modifyDate": "2020-05-28T08:46:44Z",
      "dc:description": "Display a page heading"



Now to my specific question that I am struggling with. What is the strategy for mapping this up in launch? I am used to having a much more simple page object with fixed property names (none of these dynamic names, like page-<id>), specify the structure in the contexthub extension, and easily map these up as data elements using the contexthub extension. But I am failing to see how this is done with this architecture. Will I really need to set up a rule executing some custom javascript for retrieving the "first" property, knowing that it will be the page id? Or how would one go about, for example, storing the page ID in a prop and send it to analytics? Or am I suppose to define a schema in some way, which would be able to map these up? Granted, I am new to this world of data (I come from an AEM background) but this seems like a hugely more complicated way of extracting the page data.


To further confuse me, there is in fact a guide for configuring this here but in this example, they say:

In the editor, enter the code: return adobeDataLayer.getState().page.id; " when configuring your data element.


This does not work for me, and frankly I can't see how it would (it also does not work in the browser, this could be validate here , where the datalayer is used. Perhaps I am missing some mandatory extension, that they fail to mention, or some other kind of magic? Or more likely, I simply don't "get it" yet

I would appreciate any insight here, if anyone has attempted to do the same (configuring launch and AEM core components together), or is smart enough to shine a light on how this would all hang together.



0 Replies