DataLayer source for walkerOS
npm install @walkeros/web-source-datalayerThis 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.
``sh`
npm install @walkeros/web-source-datalayer
Here's a basic example of how to use the dataLayer source:
`typescript
import { elb } from '@walkeros/collector';
import { sourceDataLayer } from '@walkeros/web-source-datalayer';
sourceDataLayer({ elb });
`
| 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 | Function to filter which dataLayer events to process | No | (event) => event && typeof event === "object"` |
Feel free to contribute by submitting an
issue, starting a
discussion, or getting in
contact.
This project is licensed under the MIT License.