Skip to content

Automatic Events

The Zori tracking script automatically captures key events without any additional code.

Event: page_view

Tracked on initial page load with:

  • Page title
  • Page path
  • Search parameters
  • Hash fragment
{
"event_name": "page_view",
"page_title": "Pricing - Acme Inc",
"page_path": "/pricing",
"page_search": "?plan=pro",
"page_hash": "#features"
}

Event: click

Every click is tracked with enhanced element detection:

{
"event_name": "click",
"element_type": "button",
"element_selector": ".cta-button",
"element_text": "Get Started",
"link_href": null,
"click_x": 450,
"click_y": 320,
"screen_width": 1920,
"screen_height": 1080
}
PropertyDescription
element_typebutton, link, input, or clickable
element_selectorOptimized CSS selector (not 10 levels deep)
element_textText content of the element
link_hrefDestination URL for links
click_x, click_yClick coordinates
screen_width, screen_heightFor heatmap normalization
data_attributesAny data-* attributes on the element

Event: session_start

Triggered when a new session begins.

Event: session_end

Triggered when a session expires, includes:

  • duration_ms - Session duration in milliseconds
  • page_count - Number of pages viewed
{
"event_name": "session_end",
"duration_ms": 542000,
"page_count": 7
}

Sessions automatically restart when:

  1. 30 minutes of inactivity pass
  2. New UTM parameters are detected (new campaign)
  3. Browser session ends (tab/window closed)

Event: user_comeback

Triggered when a user returns after being away for a significant time (>30 seconds by default).

{
"event_name": "user_comeback",
"hidden_duration_ms": 45000,
"hidden_duration_seconds": 45
}

This helps identify users who were away vs. quick tab switches.

Event: left_while_hidden

Triggered when a user closes/navigates away while the page was in a background tab.

{
"event_name": "left_while_hidden",
"hidden_duration_ms": 120000,
"hidden_duration_seconds": 120
}

Helps distinguish between active exits and background tab closures.

<script
src="https://cdn.zorihq.com/script.min.js"
data-key="your-key"
data-comeback-threshold="30000"
data-track-quick-switches="false">
</script>
OptionDefaultDescription
data-comeback-threshold30000Minimum hidden duration (ms) to trigger user_comeback
data-track-quick-switchesfalseSet to true to track all visibility changes

All events include these base properties:

PropertyDescription
visitor_idUnique visitor identifier (persists 2 years)
session_idCurrent session identifier
utm_sourceCampaign source (if present)
utm_mediumCampaign medium
utm_campaignCampaign name
utm_termCampaign term
utm_contentCampaign content
referrerHTTP referrer
user_agentBrowser user agent
page_urlFull page URL
hostPage hostname
timestampEvent timestamp (UTC)

On first visit, Zori generates a comprehensive fingerprint for visitor identification:

  • Screen resolution, color depth, orientation
  • Browser properties (user agent, platform, languages, timezone)
  • Hardware info (CPU cores, memory, touch points)
  • Canvas and WebGL fingerprints
  • Audio context fingerprint
  • Available media devices
  • Network connection info
  • Battery status (if available)

The fingerprint is stored in localStorage and helps identify returning visitors even if cookies are cleared.

CookiePurposeExpiry
zori_visitor_idAnonymous visitor tracking2 years
zori_session_idSession trackingBrowser close
zori_consentConsent preferences2 years
  • Browser fingerprint
  • Session data
  • Identified user info