Extensions: page - evolv-ai/metrics GitHub Wiki
The page extension provides mechanism/source to construct parameterized macro events on the page/window. This is useful when the events do not apply to specific dom elements, but instead are relevant to entire page/window.
Macro | Description |
---|---|
scroll:<option>:<speed/distance> | Activates on scroll distance or scroll speed. |
mouseexit:<area>:<distance> | Activates on mouse exiting off page - can specify specific area of page. |
idle:<duration> | Activates page based on idle duration in ms. |
To activate a metric based on scroll speed, use the second parameter as distance (in pixels) traveled between scroll events. In order to measure the speed of forward scroll use positive value and to measure speed in back scroll, use negative value.
For example, a popuar value for measuring exit intent on mobile devices is -80. So, for this example, the event would be specified as "scroll:speed:-80
"
To activate a metric based on scroll distance, use the second parameter (or first) as distance (in%) that the user has scrolled on a page.
For example, to activate when a user scrolls half way down a page, you would specify "scroll:50
"
To activate a metric based on mouseexit at any location on the page simply specify the event as "mouseexit:all
" or "mouseexit
" for short.
To activate a metric based on mouseexit at top of page simply specify the event as "mouseexit:top
" to exit at top along the y axis or "mouseexit:top:50
" to include exiting on the x axis within 50px to the top.
To activate a metric based on page idle, specify the duration in miliseconds as a parameter. For example: "idle:60000
" would activate the metric when the user is idle for a minute on the page. Idle is defined as no mouse movement, touch events, or keyboard events on the page.
An example of using three of these events:
{
"apply":[
{
"source": "extension",
"key": "page",
"action": "bind",
"type": "boolean",
"apply": [
{
"on": "scroll:speed:-80",
"default": false,
"value": true,
"tag": "exit.mobile"
},
{
"on": "mouseexit:top:100",
"default": false,
"value": true,
"tag": "exit.desktop"
},
{
"on": "idle:60000",
"default": false,
"value": true,
"tag": "exit.all"
}
]
}
]
}