TrackStack Docs
TrackStack Docs
DashboardPricingTrackStack DocsQuickstartExamplesSDK SetupB2B SaaS EventsSupported PlatformsIntegrationsAPI Playground
GitHub

B2B SaaS Events

Canonical event model for reliable routing across conversion destinations.

TrackStack uses a canonical event layer so product code stays stable while destination mappings can evolve.

Funnel-first event design

Instrument events around funnel stage transitions, not every click. This keeps data stable for routing, attribution, and reporting.

AARRR funnel mapped to canonical events

TrackStack canonical events map cleanly to AARRR-style analysis:

Funnel lensTrackStack canonical events
AcquisitionPageView, ContentView, SignUp
ActivationStartTrial, FirstAction, AddPaymentInfo
RetentionFeatureUsed, SubscriptionRenew
RevenuePurchase, PlanUpgrade, Refund
Referral (optional)Custom referral events if your product has invitation loops

Funnel event set

StageCanonical events
AwarenessPageView, ContentView
InterestFeatureUsed
AcquisitionSignUp, StartTrial
ActivationFirstAction, AddPaymentInfo
RevenuePurchase, PlanUpgrade, SubscriptionRenew, Refund

Winning by Design double-funnel (bowtie) mapping

Use a "double funnel" lens to separate new demand capture from post-sale expansion/retention.

Winning by Design double funnel mapped to canonical events

Practical guidance:

  • Funnel 1 (pre-sale): prioritize SignUp, StartTrial, FirstAction, and Purchase.
  • Funnel 2 (post-sale): prioritize FeatureUsed, SubscriptionRenew, and PlanUpgrade.
  • Keep one canonical payload contract across both funnels.
  • Add custom events only for lifecycle steps not covered by canonical names.

Canonical payload shape

type CanonicalCapture = {
  event:
    | "PageView"
    | "ContentView"
    | "FeatureUsed"
    | "SignUp"
    | "StartTrial"
    | "FirstAction"
    | "AddPaymentInfo"
    | "Purchase"
    | "PlanUpgrade"
    | "SubscriptionRenew"
    | "Refund";
  eventId: string;
  email?: string;
  phone?: string;
  externalId?: string;
  value?: number;
  currency?: string;
  transactionId?: string;
  plan?: string;
  pageUrl?: string;
  pageTitle?: string;
  referrer?: string;
  platformParams?: Record<string, Record<string, unknown>>;
};

Capture pattern

Use one canonical payload shape and let the edge adapt it per destination.

trackstack.capture("SignUp", {
  eventId: "evt_signup_001",
  email: "jane@example.com",
  pageUrl: "https://app.gettrackstack.com/sign-up",
});

Multiple events on one page

TrackStack supports many conversion events on a single page view (for example: ContentView -> FeatureUsed -> StartTrial).

  • Call capture() for each canonical action; do not combine unrelated actions into one payload.
  • The SDK queues and batches events before sending to /events (up to 100 events per request).
  • eventId is optional per event. Provide it only when you need deterministic dedup across systems.
trackstack.capture("ContentView", {
  email: "jane@example.com",
  contentType: "product_page",
  contentIds: ["pricing-growth"],
});

trackstack.capture("FeatureUsed", {
  email: "jane@example.com",
  feature: "roi-calculator",
});

trackstack.capture("StartTrial", {
  email: "jane@example.com",
  plan: "Growth",
});

When each event should happen

Use this as your default trigger policy to keep data quality high:

EventTrigger momentAvoid
PageViewRoute/page becomes visibleFiring multiple times for the same page load
ContentViewUser sees meaningful marketing or product contentTreating all UI sections as content views
SignUpAccount creation succeedsFiring on form submit before success
StartTrialTrial is actually provisionedSending when user only opens pricing modal
FirstActionFirst in-product value action completesCounting passive navigation as activation
AddPaymentInfoValid payment method savedFiring on payment form open
PurchaseInitial paid conversion is confirmedSending from both client and server without dedup
PlanUpgradeBilling plan increasesTreating seat count edits as upgrades unless revenue changes
SubscriptionRenewRenewal succeedsEmitting on invoice generation before payment outcome
RefundRefund is processedEmitting on request submitted but not approved

Example event JSON

{
  "events": [
    {
      "event": "Purchase",
      "eventId": "evt_123",
      "userData": {
        "email": "jane@example.com",
        "country": "US"
      },
      "customData": {
        "value": 1299,
        "currency": "USD",
        "transactionId": "txn_123",
        "plan": "Growth"
      },
      "platformParams": {
        "meta": {
          "content_type": "saas"
        }
      }
    }
  ]
}

Event quality tips

  • If you provide eventId, keep it globally unique and stable for retries.
  • Standardize canonical event names across teams before launch.
  • Include value, currency, and transactionId for revenue events.
  • Use platformParams only for explicit platform overrides.
  • For critical billing events (Purchase, PlanUpgrade, SubscriptionRenew, Refund), prefer server-side capture.

References

  • AARRR (Pirate Metrics)
  • Winning by Design - Bowtie / Double Funnel

SDK Setup

Keep app tracking code thin while edge infrastructure handles destination complexity.

Supported Platforms

Conversion destination coverage, common mappings, and override patterns.

On this page

Funnel-first event designFunnel event setWinning by Design double-funnel (bowtie) mappingCanonical payload shapeCapture patternMultiple events on one pageWhen each event should happenExample event JSONEvent quality tipsReferences