elbwalker docs
Search…
Using JavaScript
Learn how to use JavaScript to track events on a website
Walker.js uses the elbLayer to handle all events. It is possible to also trigger custom events manually using JavaScript:
1
elbLayer.push("entity action", data?, trigger?);
Copied!
Both entity and action are combined in one string separated by space and required. The optional data object holds all properties of an entity. The trigger is optional and is expected to be a string.
When working with the elbLayer make sure to initialize it properly by writing the following line before making use of the push method: elbLayer = elbLayer || [];

Examples

1
// Virtual page view of an overlay popup
2
elbLayer.push('page view', { id: '/overlay/login', name: 'Log In' }, 'visible');
3
​
4
// Add to cart
5
elbLayer.push('product add', { name: 'Everyday Ruck Snack' });
6
​
7
// Just an event
8
elbLayer.push('application confirm');
Copied!
​
Copy link
Contents