Tracking/Standard events

Standard events

Typed helpers for signups, checkouts, trials, and content views. Consistent names and property shapes that the dashboard, funnels, and attribution understand out of the box.

The event set

EventBrowser helperServer helper
content_viewedcontentViewed()captureContentViewed()
signup_completedsignedUp()captureSignedUp()
checkout_startedcheckoutStarted()captureCheckoutStarted()
checkout_cancelledcheckoutCancelled()captureCheckoutCancelled()
checkout_finishedcheckoutFinished()captureCheckoutFinished()
trial_startedtrialStarted()captureTrialStarted()
trial_endedtrialEnded()captureTrialEnded()
subscription_cancelledsubscriptionCancelled()captureSubscriptionCancelled()

Browser helpers are exported from @analyse.net/sdk. Server helpers live in @analyse.net/sdk/server, see Server side tracking.

Checkout events

All checkout_* events share a base shape with a required payment_type:

  • "one_time" for a single charge, no billing interval.
  • "subscription" requires billing_interval: "month", "year", or "week".

Common optional fields: checkout_id, amount in minor units, currency as an ISO 4217 code, product_id, plan, items_count, and coupon.

Use the same checkout_id across started, cancelled, and finished so funnels can correlate the steps:

ts
import {
  checkoutStarted,
  checkoutFinished,
} from "@analyse.net/sdk";

const checkoutId = crypto.randomUUID();

checkoutStarted({
  checkout_id: checkoutId,
  payment_type: "subscription",
  plan: "pro",
  billing_interval: "month",
  amount: 4900,
  currency: "USD",
});

// later, on success:
checkoutFinished({
  checkout_id: checkoutId,
  payment_type: "subscription",
  billing_interval: "month",
  amount: 4900,
  currency: "USD",
  plan: "pro",
});
Heads up

Browser side checkout_finished is fine for prototyping, but anyone can fire it from the console. For real revenue data, capture it server side from your Stripe webhook or billing job so it cannot be spoofed.

Content attribution

Call contentViewed on blog and docs pages with a stable content_id:

ts
import { contentViewed } from "@analyse.net/sdk";

contentViewed({
  content_id: "post_abc123",
  content_type: "blog_post",
  title: "How we handle attribution",
});

The SDK remembers content touchpoints in the browser. When the visitor later signs up, signedUp() automatically includes first_content_id, last_content_id, and content_touchpoint_count, so you can see which posts actually produce signups. Use a stable id from your CMS, not the URL slug, so renames do not break the history.

Campaign attribution

UTM parameters (utm_source, utm_medium, utm_campaign, utm_content, utm_term) are captured automatically as first touch and last touch, and merged into the person's traits when you call identify. Nothing to set up.