Intempt Docs
Developer DocsSDK

Event Tracking (SDK deep-dive)

How Intempt receives events: auto-tracking, the browser SDK's custom event methods, and the server-side Track Data API.

Overview

Intempt receives events from two places: the browser SDK running on your site, or a direct server-side call to the Track Data API. Common events (page views, sessions, clicks, form activity) are captured automatically once the SDK is installed. Anything specific to your business, like a purchase, a plan upgrade, or a signup, you send yourself, from whichever side of your stack has the data.

This page compares the two paths and links to the full reference for each. It doesn't restate their parameter tables. See the linked pages for exact fields.

Auto-tracked events

Once the JavaScript SDK loads, it records page views, sessions, clicks, and form activity without any setup on your part. See JavaScript SDK: Auto-Tracking for the full list of what's captured and how to mask sensitive on-screen text with doNotCapture.

Sending custom events

PathRuns onAuthReference
Browser SDK (track, record)Client, inside a page the SDK is loaded onHandled by the SDK's install snippetJavaScript SDK: Event Tracking
Track Data APIServer, or any environment without the SDKapiKey query parameterTrack Data

Client-side: track() and record()

Both take a single object argument. track({ eventTitle, data }) requires data to be non-empty. record() adds optional userId and accountId so a backend-context event can carry both without a separate identify()/group() call. Full parameter tables are in JavaScript SDK.

intempt.track({
  eventTitle: 'Added to cart',
  data: {
    productId: 'SKU-456',
    productName: 'Wireless Headphones',
    price: 79.99,
    quantity: 1,
  },
});

Server-side: the Track Data API

Use this when the event originates outside the browser: a webhook handler, a batch job, a subscription-renewal cron, anywhere the SDK isn't loaded. It accepts one or more named event groups per request, each with an array of payload objects. Full request/response schema, batching, and multi-event-type examples are in Track Data.

Use cases

  1. Add-to-cart on a storefront: client-side track(), fired on the button click.
  2. Subscription renewed by a billing cron job with no browser context: Track Data API.
  3. Importing historical orders from a legacy system: a single batched Track Data API request.
  4. Signup followed immediately by a first purchase: one Track Data API call with two event groups (Signup, Purchase).
  5. A purchase that should attach to both a user and a company account: record() with userId and accountId, or the Track Data API's userId/accountId payload fields.
  6. Route change inside a React/Vue/Angular SPA: auto-tracked, no code needed. See Event tracking on SPAs.
  7. A page showing an account balance or email address: mask it from auto-tracked clicks with doNotCapture, documented in JavaScript SDK: Auto-Tracking.
  8. A Stripe or Shopify webhook handler pushing order events into Intempt: Track Data API, authenticated with the source's apiKey.
  9. Merging an anonymous session with a known identity after login: track()/record() client-side, then alias() to link the two IDs.

Where to go next

On this page