intempt:session

Usage example

The following JavaScript snippet demonstrates how to listen for the intempt:session event, which is automatically emitted by the auto-tracker for various Session events. This custom event includes a detail property that provides additional information about the event triggered:

document.addEventListener('intempt:session', (event) => {
  const { detail } = event;
  const { eventName, region, city, country , ip, eventCounter, duration, type } = detail;

//Your logic here
})

This Page View listener event contains a detail property, which is a part of the custom event. The detail object contains:

  • eventName: name of the event which was passed to intempt:session event , like "Start Session", "View Page", or any other Auto and Custom event
  • region: The region in which the user is located, can be an empty string if location data is blocked.
  • city: The city of the user, can also be an empty string if location data is blocked.
  • country: Country of the user. This too can be an empty string if the website blocks the request for location data.
  • ip: The IP address from which the session is initiated. May be an empty string if IP data retrieval is blocked.
  • eventCounter: A numerical value indicating the number of events recorded in the session so far.
  • duration: The duration of the session until the event was triggered.This value is undefined for the "Start Session" event as no time on the session has yet been accumulated.
  • type: The type of session event. Can indicate whether the session is just starting ("sessionStart"), ending ("sessionEnd")