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

A gtag consent update is captured from the dataLayer as a walker dataLayer consent update event.

Event
Out

Direct dataLayer event

A plain object pushed directly onto the dataLayer is captured as a walker dataLayer custom event.

Event
Out

gtag add_to_cart

A gtag add_to_cart call pushed to the dataLayer is captured as a walker dataLayer add_to_cart event.

Event
Out

gtag purchase

A gtag purchase call pushed to the dataLayer is captured as a walker dataLayer purchase event with item details.

Event
Out

gtag view_item

A gtag view_item call pushed to the dataLayer is captured as a walker dataLayer view_item event with item data.

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)