elbwalker docs
Search…
Walker.js basics
Using walker.js you can track every user interaction without writing a single line of javascript. You just have to add the HTML attributes to your site.
You define the entity scope by setting the elb attribute with the name of an entity to an element, e.g. elb="product".
An action can be added by setting the elbaction attribute on the same level or all child-elements in combination with a matching trigger, e.g. elbaction="click:add" to fire a product add event when a user clicks on the tagged element.
To define the entities properties, set the composited attribute elb-ENTITY with the name and value, e.g. elb-product="name:Everyday Ruck Snack".

Full code example

1
<div elb="product" elb-product="name:Everyday Ruck Snack">
2
<button elbaction="click:add">Add to cart</button>
3
</div>
4
​
5
<!-- General usage -->
6
<div elb="ENTITY" elb-ENTITY="KEY:VALUE" elbaction="TRIGGER:ACTION" />
Copied!
The walker will generate an event of the following structure based just on HTML tags.
1
{
2
"event": "ENTITY ACTION", // combination of entity and action
3
"data": {}, // all set properties with the elb-product attribute
4
"globals": {}, // all set properties with the elbglobals attribute
5
"user": {}, // anonymous user ids (id, device, hash)
6
"nested": [], // all nested entities within the product
7
"id": "EVENTID", // timestamp, group & count of the event
8
"trigger": "TRIGGER", // name of the trigger that fired
9
"entity": "ENTITY", // entity name
10
"action": "ACTION", // entity action
11
"timestamp": 1647968113641, // time when the event fired
12
"timing": 13.37, // how long it took from the page load to trigger the event
13
"group": "GROUPID", // random group id for all events on a page
14
"count": 1, // incremental counter of the events on a page
15
"walker": true // flag to filter events
16
}
Copied!
Spaces in entities, e.g. "shopping cart" or actions, e.g. "add to cart" will be replaced by underscores to "shopping_cart" and "add_to_cart".
Spaces in property values are no problem, e.g. "category: 'summer sale'" works fine. But better set them in quotes when doing so or when using symbols, especially : or ;
GitHub - elbwalker/walker.js: An open-source analytics library to measure user events the hassle-free way.
GitHub
⭐️ us on GitHub if you like it
Copy link
Contents