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
Option 2: CDN
Basic Setup
1. Add Event Queueing (Recommended)
Add this script before walker.js loads to queue events during initialization:
2. Include Walker.js
3. Configure Destinations
Configuration Options
Walker.js supports multiple configuration approaches with different priorities:
- Script tag
data-elbconfig(highest priority) window.elbConfig(default fallback)- Manual initialization (when
run: false)
Settings
| Property | Type | Description | More |
|---|---|---|---|
elb | string | Global function name for event tracking | |
name | string | Global instance name | |
run | boolean | Auto-initialize walker.js on load | |
browser | object | Browser source configuration. Set to false to disable. See browser configuration section below for details. | |
dataLayer | object | DataLayer source configuration. Set to true for defaults or object for custom config. See dataLayer configuration section below. | |
collector | object | Collector configuration including destinations and consent settings. See collector configuration section below. |
Browser Source Settings
| Property | Type | Description | More |
|---|---|---|---|
browser.run | boolean | Auto-start DOM tracking | |
browser.session | boolean | Enable session tracking | |
browser.scope | string | DOM element scope for tracking | |
browser.pageview | boolean | Enable automatic page view events |
DataLayer Settings
| Property | Type | Description | More |
|---|---|---|---|
dataLayer | boolean | Enable dataLayer integration with defaults | |
dataLayer.name | string | DataLayer variable name | |
dataLayer.prefix | string | Event prefix for dataLayer events |
Collector Settings
| Property | Type | Description | More |
|---|---|---|---|
collector.consent | object | Default consent state | |
collector.destinations | object | Destination configurations. See destinations documentation for available options. |
Full Configuration Object
Inline Configuration
Configure directly in the script tag using simple key:value pairs:
Named Configuration Object
Use a custom configuration object name:
Usage
Automatic DOM Tracking
Walker.js automatically tracks events based on HTML data attributes:
For detailed information on data attributes, see the Browser Source documentation.
Manual Event Tracking
Use the global elb function for manual tracking:
DataLayer Integration
Walker.js can integrate with existing dataLayer implementations:
Advanced Features
Async Loading & Event Queueing
Walker.js handles async loading gracefully with automatic event queueing:
Build Variants
Walker.js provides multiple build formats for different environments:
walker.js- Standard IIFE bundle for browsersindex.es5.js- GTM-compatible ES2015 buildindex.mjs- ES modules for modern bundlersindex.js- CommonJS for Node.js environments
Programmatic Usage
Use walker.js programmatically in applications:
Destination Configuration
Configure multiple destinations for your events:
For comprehensive destination options, see the Destinations documentation.
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
Creates a new walker.js instance with the provided configuration.
Instance Properties
collector- The walkerOS collector instanceelb- Browser push function for event tracking
Utility Functions
Related Documentation
- Browser Source - Detailed DOM tracking capabilities
- Collector - Event processing and routing
- Destinations - Available destination options
- DataLayer Source - DataLayer integration details
Walker.js combines all these components into a single, easy-to-use package perfect for getting started with walkerOS quickly.