The track()
method allows you to track your own events which will be shown directly in the recording.
Syntax
track(eventName)
track(eventName, eventDetail)
Parameters
eventName
- Name of the event,
string
.
eventDetail
- Optional serializable
Object
which contains additional details to the event.
Return value
void
Description
Smartlook.track()
helps you track custom events that can't be tracked by click, URL, or input change.
In Smartlook app, section Events, you may filter based on the tracked data. See more on Custom events.
track()
does not trigger upload to the server immediately, it may take a couple of seconds to store the event. Therefore custom events tracked right before closing the website might not be recorded.
Examples
Track category opening.
Smartlook.track('open-category', {
name: 'category1'
})