Getting started
WelcomeAPI Changelog
JavaScript API
IntroductionConfigurationMethodsRecording conditionsEventRate limitsTutorialsPlatforms
Rest API
Webhooks

Recording start conditions

Using newPageView method you can specify your own conditions as a trigger for a recording.

Example condition

{type: "event", name: "MouseClick", operator: "contain", key:"path", value: ".add-cart"}

This condition will be fulfilled when user click on element where "path" contain ".add-cart" value.

Example use

__ls("newPageView", {conditions: [
{type: "event", name: "MouseClick", operator: "contain", key:"path", value: ".add-cart"},
]});

Types

NameDescription
eventUse to specify condition based on user interaction (event).

Operator types

NameDescriptionCondition
startstarts frombase.indexOf(value) == 0
containcontainbase.indexOf(value) > -1
endends withbase.indexOf(value) == base.length - value.length
eqequal tobase == value
neqnot equal tobase !== value
gtgreater thanbase > value
gtegreater than or equalbase >= value
ltlower thanbase < value
ltelower than or equalbase <= value

Operators' condtions are case sensitive.

Event

Types

NameDescription
MouseClickmouse click
RageClickrage click
ErrorClickerror click
Scrollscoll inside any element
WindowScrollscoll main window
MouseMovemouse move
TouchMovemobile touch move

Keys

NameDescriptionExample
pathFull DOM path to elementbody > #header > .link.add-cart[href="/cart"]
elElement identificator.link.add-cart[href="/cart"]
txtText content of elementAdd to cart

Default conditions

If conditions are not specified, by default newPageView use conditions below for starting new pageView:

[{ type: "event", name: ["MouseMove", "TouchMove", "Scroll", "WindowScroll"] }]

Recording starts when one of events (MouseMove, TouchMove, Scroll, WindowScroll) occurs.