Skip to content

adobe/content-analytics

@adobe/content-analytics

Build npm npm

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.

Installation

npm install @adobe/content-analytics

Usage

import initializeContentLibrary from "@adobe/content-analytics";

initializeContentLibrary({
  datastreamId: "your-datastream-id",
  includeExperiences: true,
});

Options

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)

Requirements

  • Adobe Experience Platform Web SDK (Alloy) must be initialized
  • Modern browser with IntersectionObserver and MutationObserver support

Development

npm install
npm test
npm run build
npm run lint

Contributing

Contributions are welcome! See Contributing Guide for more information.

License

Apache-2.0. See LICENSE for details.

About

Content analytics utilities and resources for measuring and improving content performance

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors