DataLayer source
Integrates with existing Google Analytics 4 and GTM dataLayer implementations by intercepting dataLayer.push() calls.
The DataLayer source is a web source in the walkerOS flow:
It bridges existing GA4/GTM implementations to walkerOS destinations.
Installation
- Integrated
- Bundled
Configuration
This source uses the standard source config wrapper (consent, data, env, id, ...). For the shared fields see source configuration. Package-specific fields live under config.settings and are listed below.
Settings
| Property | Type | Description | More |
|---|---|---|---|
name | string | DataLayer variable name (default: dataLayer) | |
prefix | string | Event prefix for filtering which events to process | |
filter | function | Custom filter function: (event: unknown) => boolean | Promise<boolean> |
Mapping
Per-event rules under config.mapping. For the standard rule fields (consent, condition, data, batch, name, policy) see mapping.
| Property | Type | Description | More |
|---|---|---|---|
command | any | Mapping.Value evaluated against the raw dataLayer arguments to build walker command data (e.g. consent updates). |
Examples
consent update
direct event
gtag add to cart
gtag purchase
gtag view item
How it works
The dataLayer source intercepts dataLayer.push() calls and transforms them into walkerOS events:
- Intercepts existing
dataLayer.push()calls - Filters events based on prefix or custom filter function
- Transforms dataLayer format to walkerOS event format
- Forwards to collector for processing
Custom filtering
Filter which dataLayer events get processed:
Migration strategy
Use the dataLayer source for gradual migration from GA4/GTM:
Phase 1: Add walkerOS alongside existing dataLayer
Phase 2: Map dataLayer events to walkerOS destinations
Phase 3: Gradually replace dataLayer.push with elb()
Next steps
- Review event mapping for transforming dataLayer events
- Check GA4 destination for Google Analytics integration