Intempt Docs

intempt:html, intempt:page, intempt:session

Intempt automatically emits three browser-level DOM events for debugging, customization, enrichment, and advanced tracking logic.

intempt:html, intempt:page, intempt:session

Intempt automatically emits three types of browser-level events as native DOM events accessible via document.addEventListener(). These are designed for debugging, customization, enrichment, and advanced tracking logic — no additional setup required.


intempt:html — HTML Interactions

Captures DOM-level user interactions: clicks, input changes, and form submissions.

Use this event to:

  • Inspect raw DOM interactions
  • Add custom logic to clicks or input changes
  • Debug auto-tracked behavior
  • Trigger custom events based on user actions
document.addEventListener('intempt:html', (event) => {
  const { detail } = event;
  const { eventName, target } = detail;

  if (eventName === 'click' && target.id === 'signup-btn') {
    // Custom logic on signup button click
    console.log('Signup button clicked');
  }
});

Available Properties

PropertyTypeDescription
eventNamestringDOM event type: "click", "change", or "submit"
targetHTMLElementThe element involved in the interaction

intempt:page — Page View Events

Tracks page-level activity including views, exits, and navigation context. Works in Single Page Applications (SPAs).

Use this event to:

  • Track page views and exits manually
  • Access page metadata (URL, title, time spent)
  • Implement navigation-based custom logic
  • Monitor SPA route changes
document.addEventListener('intempt:page', (event) => {
  const { detail } = event;
  const {
    eventName,
    fullUrl,
    title,
    windowWidth,
    pageId,
    duration,
    previousPage
  } = detail;

  if (eventName === 'Leave page') {
    console.log(`User spent ${duration}ms on ${title}`);
  }
});

Available Properties

PropertyTypeDescription
eventNamestring"View page" or "Leave page"
fullUrlstringComplete URL of the current page
titlestringPage or document title
windowWidthnumberBrowser window width in pixels
pageIdstringUnique identifier for this page view
durationnumberTime spent on page in milliseconds (undefined for view events)
previousPagestringURL of the previously visited page

intempt:session — Session Lifecycle Events

Emits events at session start and end with session-level metadata including location and activity volume.

Use this event to:

  • Understand session boundaries
  • Conduct session-level analytics
  • Trigger logic at session start or end
  • Analyze session duration and event counts
document.addEventListener('intempt:session', (event) => {
  const { detail } = event;
  const {
    eventName,
    region,
    city,
    country,
    ip,
    eventCounter,
    duration,
    type
  } = detail;

  if (type === 'sessionEnd') {
    console.log(`Session ended after ${duration}ms with ${eventCounter} events`);
  }
});

Available Properties

PropertyTypeDescription
eventNamestringEvent name within the session
regionstringUser's region (empty string if geo-blocked)
citystringUser's city (empty string if geo-blocked)
countrystringUser's country (empty string if geo-blocked)
ipstringUser IP address (empty string if blocked)
eventCounternumberTotal events recorded in this session
durationnumberSession duration in milliseconds (undefined for start events)
typestring"sessionStart" or "sessionEnd"

Combining All Three Events

// Log all Intempt DOM events for debugging
['intempt:html', 'intempt:page', 'intempt:session'].forEach((eventType) => {
  document.addEventListener(eventType, (event) => {
    console.log(`[${eventType}]`, event.detail);
  });
});

On this page