Sources
Sources are the entry points for event data in walkerOS. They capture events from different environments and formats, then transform them into standardized events that the collector can process.
In a typical application, events can come from many different places:
- DOM interactions in the browser (clicks, form submissions, page views)
- dataLayer pushes from other tracking tools
- Server-side events from APIs
- Custom application events
Each of these has its own format and structure. Sources provide a clean separation between:
- Event capture - How events are detected and collected
- Event processing - How events are enriched, filtered, and sent to destinations
This separation makes walkerOS flexible and maintainable, allowing you to add new event sources without changing your destination configurations.
walkerOS is primarily build to capture events directly from the browser.
How sources work
Basic flow
- Capture: Sources listen for or capture events in their native format
- Transform: Convert the captured data into walkerOS event format
- Send: Push the standardized event to the collector for processing
Setup within walkerOS
import { createCollector } from '@walkeros/collector';
import { createSource, sourceBrowser } from '@walkeros/core';
// Create a collector
const { collector } = await createCollector({
destinations: {
/* your destinations */
},
});
// Add a browser source
const { elb } = await createSource(collector, sourceBrowser, {
session: true,
pageview: true,
});
// The source captures browser events and sends them to your collector
Available Sources
Browser
The browser source captures events from web pages:
- DOM interactions: All sorts of user behavior like clicks, form submissions, views etc.
- Automatic tracking: Page views, session management
- Flexible configuration: Customize what gets tracked and how
dataLayer
The dataLayer source works with existing analytics implementations:
- Legacy integration: Works with existing GA4 and dataLayer implementations
- Event mapping: Transform dataLayer events to walkerOS format
- Migration friendly: Gradual transition from existing setups
Using Sources
Basic Setup
Every source follows the same pattern:
- Create a collector with your destination configuration
- Add sources using
createSource
with the source type and configuration - Use the returned
elb
function to trigger events manually when needed
Next Steps
Choose the source that matches your environment for more details: