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
| Path | Runs on | Auth | Reference |
|---|---|---|---|
Browser SDK (track, record) | Client, inside a page the SDK is loaded on | Handled by the SDK's install snippet | JavaScript SDK: Event Tracking |
| Track Data API | Server, or any environment without the SDK | apiKey query parameter | Track 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
- Add-to-cart on a storefront: client-side
track(), fired on the button click. - Subscription renewed by a billing cron job with no browser context: Track Data API.
- Importing historical orders from a legacy system: a single batched Track Data API request.
- Signup followed immediately by a first purchase: one Track Data API call with two event groups (
Signup,Purchase). - A purchase that should attach to both a user and a company account:
record()withuserIdandaccountId, or the Track Data API'suserId/accountIdpayload fields. - Route change inside a React/Vue/Angular SPA: auto-tracked, no code needed. See Event tracking on SPAs.
- A page showing an account balance or email address: mask it from auto-tracked clicks with
doNotCapture, documented in JavaScript SDK: Auto-Tracking. - A Stripe or Shopify webhook handler pushing order events into Intempt: Track Data API, authenticated with the source's
apiKey. - Merging an anonymous session with a known identity after login:
track()/record()client-side, thenalias()to link the two IDs.
Where to go next
- Complete guide to event tracking: step-by-step walkthrough from install to custom events.
- JavaScript SDK: full method reference (
track,record,identify,alias,group,consent, product tracking, DOM events). - Track Data: server-side ingestion endpoint reference.
- Event tracking on SPAs: SPA-specific tracking strategy.
