Talivia Docs
Talivia Docs
HomeDashboard
IntroductionInstallationTeamGetting updates
Tracking overviewTracker functionsTracker configurationSubdomain trackingCross-domain trackingTrack eventsDistinct IDsTagsLinksPixels
Integrations
AI agents and MCPllms.txtllms-full.txt
Tracking

Tracker functions

Use window.talivia to track page views, events, identity, and checkout session context.

View Markdown

The tracker exposes a small browser API after the script loads.

Track a page view

window.talivia.track();

Use this when automatic tracking is disabled or when you need to manually send a page view after a route transition.

Track a custom event

window.talivia.track('signup-button');

Event names are limited to 50 characters.

Track an event with data

window.talivia.track('signup-button', {
  plan: 'pro',
  location: 'pricing',
});

Event data can include strings, numbers, arrays, and nested objects. Keep payloads small: Talivia truncates long strings and limits object shape so reports stay fast.

Override page properties

window.talivia.track({
  website: 'YOUR_WEBSITE_ID',
  url: '/pricing',
  title: 'Pricing',
});

Use a function

window.talivia.track(props => ({
  ...props,
  url: '/checkout',
  title: 'Checkout',
}));

The function receives the current tracker payload and returns the payload to send.

Identify a visitor

window.talivia.identify('user_123', {
  email: 'founder@example.com',
  stripeCustomerId: 'cus_123',
});

Use identify after login or signup. Talivia stores session data and can connect a payment provider customer to the visitor.

Read checkout context

const sessionId = window.talivia.getSessionId();

await fetch('/api/create-checkout', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ sessionId }),
});

getSessionId() returns the opaque value stored in the talivia_session_id first-party cookie. Send only this value to your backend and attach it as talivia_session_id provider metadata. It is an attribution identifier, not an authentication credential.

Tracking overview

Previous Page

Tracker configuration

Next Page