Adobe Content Analytics Library — standardized collection of content interactions (page views, asset views, clicks, scroll depth) for reporting. Sends events to Adobe Experience Platform via Alloy Web SDK.
npm install @adobe/content-analyticsimport initializeContentLibrary from "@adobe/content-analytics";
initializeContentLibrary({
datastreamId: "your-datastream-id",
includeExperiences: true,
});| Option | Type | Default | Description |
|---|---|---|---|
datastreamId |
string | required | AEP datastream ID |
includeExperiences |
boolean | false |
Enable page/experience tracking |
assetUrlQualifier |
string | - | RegEx pattern to filter assets by URL |
pageUrlQualifier |
string | - | RegEx pattern to filter pages by URL |
scrollDepthCollectionEnabled |
boolean | true |
Track scroll depth |
assetsMaxBatchLength |
number | 32 |
Max assets before auto-send |
imagesSelector |
string | "img" |
CSS selector for images |
debounceNodeRegister |
number | 500 |
Debounce for DOM observation (ms) |
throttleSendContentEvent |
number | 500 |
Throttle for event sending (ms) |
- Adobe Experience Platform Web SDK (Alloy) must be initialized
- Modern browser with IntersectionObserver and MutationObserver support
npm install
npm test
npm run build
npm run lintContributions are welcome! See Contributing Guide for more information.
Apache-2.0. See LICENSE for details.