@walkeros/web-source-datalayer
v2.0.1
Published
DataLayer source for walkerOS
Maintainers
Readme
DataLayer Source for walkerOS
This package provides a dataLayer source for walkerOS. It allows you to process events from a dataLayer and send them to the walkerOS collector.
walkerOS follows a source → collector → destination architecture. This dataLayer source monitors the browser's dataLayer (commonly used with Google Tag Manager) and transforms existing gtag() calls and dataLayer.push() events into standardized walkerOS events, enabling seamless migration from traditional dataLayer implementations.
Installation
npm install @walkeros/web-source-datalayerUsage
Here's a basic example of how to use the dataLayer source:
import { elb } from '@walkeros/collector';
import { sourceDataLayer } from '@walkeros/web-source-datalayer';
sourceDataLayer({ elb });Configuration
| Name | Type | Description | Required | Example |
| -------- | ------------------------------------------------------ | ------------------------------------------------------------- | -------- | ----------------------------------------------- |
| name | string | DataLayer variable name (default: "dataLayer") | No | 'dataLayer' |
| prefix | string | Event prefix for filtering dataLayer events (default: "gtag") | No | 'gtag' |
| filter | (event: unknown) => WalkerOS.PromiseOrValue<boolean> | Function to filter which dataLayer events to process | No | (event) => event && typeof event === "object" |
Contribute
Feel free to contribute by submitting an issue, starting a discussion, or getting in contact.
License
This project is licensed under the MIT License.
