Skip to main content

walker.js

Walker.js is a pre-built walkerOS application that combines both the browser and dataLayer sources with the collector and a default dataLayer destination into a pre-build package. It's designed for users who want instant web tracking without complex setup or configuration.

Installation

Option 1: npm package

Loading...

Option 2: CDN

Loading...

Basic setup

Add this script before walker.js loads to queue events during initialization:

Loading...

2. Include walker.js

Loading...

3. Configure destinations

Loading...

Configuration options

Walker.js supports multiple configuration approaches with different priorities:

  1. Script tag data-elbconfig (highest priority)
  2. window.elbConfig (default fallback)
  3. Manual initialization (when run: false)

Settings

PropertyTypeDescriptionMore
collectoranyCollector configuration (Collector.InitConfig)
browseranyBrowser source configuration (Partial<SourceBrowser.Settings>)
dataLayerboolean | anyDataLayer configuration (boolean | Partial<SourceDataLayer.Settings>)
elbstringName for the global elb function (default: "elb")
namestringName for the global instance
runbooleanAuto-run on initialization (default: true)

Browser source settings

PropertyTypeDescriptionMore
prefix*stringPrefix for data attributes (default: data-elb)
scopestringDOM scope for event tracking (default: document)
pageview*booleanEnable automatic pageview tracking
session*boolean | anyEnable session tracking (boolean or SessionConfig object)
elb*stringName for global elb function
namestringCustom name for source instance
elbLayer*boolean | string | anyEnable elbLayer for async command queuing (boolean, string, or Elb.Layer)
* Required fields

DataLayer settings

PropertyTypeDescriptionMore
namestringDataLayer variable name (default: dataLayer)
prefixstringEvent prefix for filtering which events to process
filterfunctionCustom filter function: (event: unknown) => boolean | Promise<boolean>

Collector settings

PropertyTypeDescriptionMore
runbooleanWhether to run collector automatically on initialization
taggingnumberTagging version number
globalsStaticRecord<string, any>Static global properties that persist across collector runs
sessionStaticRecord<string, any>Static session data that persists across collector runs
verbosebooleanEnable verbose logging for debugging
onErrorfunctionError handler function: (error, state?) => void
onLogfunctionLog handler function: (message, verbose?) => void
consentRecord<string, boolean>Initial consent state
useranyInitial user data
globalsRecord<string, any>Initial global properties
sourcesanySource configurations
destinationsanyDestination configurations
customRecord<string, any>Initial custom implementation-specific properties

Full configuration object

Loading...

Inline configuration

Configure directly in the script tag using simple key:value pairs:

Loading...

Named configuration object

Use a custom configuration object name:

Loading...

Usage

Automatic DOM tracking

Walker.js automatically tracks events based on HTML data attributes:

Loading...

For detailed information on data attributes, see the Browser Source documentation.

Manual event tracking

Use the global elb function for manual tracking:

Loading...

DataLayer integration

Walker.js can integrate with existing dataLayer implementations:

Loading...

Advanced features

Async loading and event queueing

Walker.js handles async loading gracefully with automatic event queueing:

Loading...

Build variants

Walker.js provides multiple build formats for different environments:

  • walker.js - Standard IIFE bundle for browsers
  • index.es5.js - GTM-compatible ES2015 build
  • index.mjs - ES modules for modern bundlers
  • index.js - CommonJS for Node.js environments

Programmatic usage

Use walker.js programmatically in applications:

Loading...

Destination configuration

Configure multiple destinations for your events:

Loading...

For comprehensive destination options, see the Destinations documentation.

Growing beyond walker.js

Walker.js is a convenience bundle that combines Browser Source, DataLayer Source, and Collector into a single file. It's perfect for getting started, but you may outgrow it.

When to stay with walker.js

  • ✅ Simple tracking needs (pageviews, clicks, forms)
  • ✅ Static sites or traditional server-rendered pages
  • ✅ Quick proof-of-concept or MVP
  • ✅ Teams who prefer minimal setup

When to upgrade

Consider moving to full Integrated or Bundled mode when you need:

NeedSolution
Server-side trackingBundled mode with Docker
Custom sources (HTTP, AWS, GCP)Both modes support server sources
Multiple flows per pageFull Collector configuration
TypeScript integrationIntegrated mode
CI/CD versioned configsBundled mode
Event mapping/transformationBoth modes with mapping config

Migration path

Walker.js configuration maps directly to full modes:

// walker.js equivalent in Integrated mode
import { startFlow } from '@walkeros/collector';
import { sourceBrowser } from '@walkeros/web-source-browser';

const { elb } = await startFlow({
sources: {
browser: {
code: sourceBrowser,
config: { settings: { pageview: true, session: true } },
},
},
destinations: {
// Your destinations here
},
run: true,
});

The mental model is the same (sources, collector, destinations), just with more control.

Troubleshooting

Common issues

Events not firing: Check that walker.js loaded and configuration is valid.

Missing events: Ensure event queueing function is added before walker.js.

Configuration not applied: Verify data-elbconfig points to the correct object name.

API reference

Factory function

Loading...

Creates a new walker.js instance with the provided configuration.

Instance properties

  • collector - The walkerOS collector instance
  • elb - Browser push function for event tracking

Utility functions

Loading...

Walker.js combines all these components into a single, easy-to-use package perfect for getting started with walkerOS quickly.

💡 Need Professional Support?
Need professional support with your walkerOS implementation? Check out our services.