Data Layer events are not being picked up for the OOTB PDF viewer | Community
Skip to main content
Level 4
June 3, 2026
Question

Data Layer events are not being picked up for the OOTB PDF viewer

  • June 3, 2026
  • 3 replies
  • 85 views

The sling:configs node is created and the enabled property is set to true for the node com.adobe.cq.wcm.core.components.internal.DataLayerConfig for the given site. The PDFs are loading from the Adobe embed component that cretaes PDFs using iframes. How to fetch events int the data layer?

3 replies

v-lazar
Level 2
June 3, 2026

@ChinmayiSh, the OSGi config you enabled (DataLayerConfig) only powers the page and core component events on the parent page. The Adobe PDF Embed component renders the PDF inside an iframe and its events do not flow into window.adobeDataLayer automatically.

 

The fix is to register a PDF Embed API callback. After you create the viewer with new AdobeDC.View(...) and call previewFile(...), the returned promise resolves to an adobeViewer instance. On that instance, registerCallback with type AdobeDC.View.Enum.CallbackType.EVENT_LISTENER and pass options with enablePDFAnalytics set to true. That last flag is the key, without it you only get a minimal subset, with it you get PAGE_VIEW, BOOKMARK_ITEM_CLICK, ANNOTATION_*, TEXT_COPY, and the rest.

 

Inside the callback, push the event to window.adobeDataLayer with your own event schema. On the Launch side, create a rule that fires on that ACDL event name and maps the fields into your Analytics or Web SDK call.

 

If you have a CMP that blocks scripts before consent, both the Embed API initialization and the ACDL push need to be gated until Launch is not blocked at the time the events fired.

 

If you can share which AEM version you are on (6.5 or AEMaaCS) and whether you are on Launch or Web SDK, I can be more specific on the downstream mapping.

https://www.linkedin.com/in/viktor-lazar/ | https://cyber64.com/insights
v-lazar
Level 2
June 3, 2026

@ChinmayiSh working poc with Adobe Embed API
https://pdf-acdl-bridge-cyber64.pages.dev/
Let me know if you need any further support

https://www.linkedin.com/in/viktor-lazar/ | https://cyber64.com/insights
Nilesh_Mali
Level 3
June 9, 2026

 

Hi ​@ChinmayiSh 

If you're using the Core Components PDF Viewer / Adobe Embed PDF Viewer, it's important to note that AEM Data Layer events are not automatically generated for PDF interactions (such as page views, zoom, download, search, etc.).

The PDF is rendered inside an iframe, and the standard AEM Core Components Data Layer only captures events implemented by the component itself. Events occurring within the embedded PDF viewer are isolated inside the iframe and are not automatically pushed to the parent page's Data Layer.

To track PDF interactions, you typically need to:

  • Use the Adobe PDF Embed API Analytics Events.

  • Register event listeners such as:

    • PAGE_VIEW

    • DOCUMENT_OPEN

    • DOCUMENT_DOWNLOAD

    • TEXT_SEARCH

    • ZOOM_LEVEL

  • Push those events manually into adobeDataLayer or your analytics solution.

Example:

adobeDCView.registerCallback(
AdobeDC.View.Enum.CallbackType.EVENT_LISTENER,
function(event) {
window.adobeDataLayer = window.adobeDataLayer || [];
window.adobeDataLayer.push({
event: "pdfInteraction",
pdfEvent: event.type
});
}
);

So if the Data Layer is enabled correctly but you're expecting PDF-specific events, that behavior is expected. Additional integration with the PDF Embed API event framework is usually required.

TarunKumar
Community Advisor
Community Advisor
June 9, 2026

Hi ​@ChinmayiSh ,
 

The Adobe PDF Embed component renders PDFs within an iframe, meaning its internal events cannot automatically flow to the parent window's adobeDataLayer You must register a specific PDF Embed API callback on the instance to capture and push the analytics to your data layer.

How to Implement the Fix

To pick up PDF events (e.g., page views, text copies, or annotations), use the following approach: 

  1. Register the PDF Embed Callback!->: After creating the viewer and calling previewFile, intercept the returned promise to get the adobeViewer instance.
  2. Enable Analytics & Push to Data Layer!--tgqphd|[]-->: Register a listener with enablePDFAnalytics set to true, and push those events into window.adobeDataLayer>

Javascript

adobeDC.View.createInstance({
clientId: "YOUR_CLIENT_ID",
divId: "adobe-dc-view"
}).then(adobeViewer => {
adobeViewer.registerCallback(
AdobeDC.View.Enum.CallbackType.EVENT_LISTENER,
function(event) {
// Push the PDF event data into your Adobe Client Data Layer
window.adobeDataLayer.push({
"event": "pdf:interaction",
"pdf": event
});
},
{ enablePDFAnalytics: true } // Crucial for getting granular PDF events
);
});