Skip to main content
Source code Package

DataLayer source

Integrates with existing Google Analytics 4 and GTM dataLayer implementations by intercepting dataLayer.push() calls.

Where this fits

The DataLayer source is a web source in the walkerOS flow:

It bridges existing GA4/GTM implementations to walkerOS destinations.

Installation

Loading...
Loading...

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

PropertyTypeDescriptionMore
namestringDataLayer variable name (default: dataLayer)
prefixstringEvent prefix for filtering which events to process
filterfunctionCustom 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.

PropertyTypeDescriptionMore
commandanyMapping.Value evaluated against the raw dataLayer arguments to build walker command data (e.g. consent updates).

Examples

consent update

Event
Out

direct event

Event
Out

gtag add to cart

Event
Out

gtag purchase

Event
Out

gtag view item

Event
Out

How it works

The dataLayer source intercepts dataLayer.push() calls and transforms them into walkerOS events:

  1. Intercepts existing dataLayer.push() calls
  2. Filters events based on prefix or custom filter function
  3. Transforms dataLayer format to walkerOS event format
  4. Forwards to collector for processing
Loading...

Custom filtering

Filter which dataLayer events get processed:

Loading...

Migration strategy

Use the dataLayer source for gradual migration from GA4/GTM:

Phase 1: Add walkerOS alongside existing dataLayer

Loading...

Phase 2: Map dataLayer events to walkerOS destinations

Loading...

Phase 3: Gradually replace dataLayer.push with elb()

Loading...

Next steps

💡 Need implementation support?
elbwalker offers hands-on support: setup review, measurement planning, destination mapping, and live troubleshooting. Book a 2-hour session (€399)