pex

PLG Quickstart

Get Apex configured for product-led growth in under 10 minutes.

Prerequisites

  • An Apex account (sign up free)
  • A web application with user authentication
  • Access to your backend to install the server SDK

How PLG Differs in Apex

When you select a product-led or hybrid growth model during onboarding, Apex adapts:

  • Scoring shifts from MQL (intent, ICP fit) to PQL (activation, usage, expansion, retention)
  • Funnel tracks Signups → Activated → Active → Converted instead of Visitors → Leads → Customers
  • Dashboard emphasizes activation rates, usage depth, and time-to-value over pipeline and CAC

Step 1: Install the Tracking Snippet

Add these two lines to your app's <head> for client-side tracking. The inline anti-flicker stub keeps your page hidden while experiments apply, then the async script removes it. See Installation for the full reference.

<style id="apex-antiflicker">html{opacity:0!important;transition:opacity .12s}</style>
<script src="https://your-apex-url/api/apex-js?key=YOUR_WORKSPACE_KEY" async></script>

Step 2: Install the Server SDK

For PLG, server-side events are critical — they're the source of truth for milestones the browser can't reliably see. Install the NPM SDK:

npm install @apex-inc/sdk

The SDK is a set of functions (not a class). Initialize it once at startup:

import { init, identify, track, sendServerEvent } from "@apex-inc/sdk";

init({ workspaceKey: "YOUR_WORKSPACE_KEY" });

Info

Client vs server — the rule: behavioral signal (page views, clicks, in-app UI steps) belongs on the client snippet; source-of-truth milestones (activation, plan changes, payments) belong on the server via sendServerEvent. Never emit the same canonical event name from both, or you'll double-count. See Instrumenting your app.

Step 3: Identify Users at Signup

When a user signs up, call identify with their email and the browser's apex_vid cookie value. The visitorId trait is what stitches the anonymous visitor to the authenticated user:

identify("user@example.com", {
  visitorId: req.cookies["apex_vid"],
  name: user.name,
  plan: "free",
});

This stitches anonymous visitor behavior to the authenticated user, giving you full-funnel attribution.

Step 4: Track Activation Milestones

Activation is a source-of-truth outcome — emit it server-side so an ad blocker or a closed tab can never lose it. Apex ships canonical milestone events (onboarding_completed, activated); use them:

await sendServerEvent(
  { apiKey: process.env.APEX_API_KEY, workspaceKey: "YOUR_WORKSPACE_KEY" },
  { type: "activated", visitorId: req.cookies["apex_vid"], data: { criterion: "first_workspace_created" } },
);

In-app steps (as opposed to the final outcome) are fine on the client, where the step happens:

track("onboarding_step_completed", { step_id: "invited_teammate" });

Step 5: Set Up Activation Goals

In the Apex dashboard:

  1. Go to Goals and create a conversion goal
  2. Select Custom event as the type
  3. Enter your activation event name (e.g., first_workspace_created)
  4. This becomes the key metric for your PQL score and activation funnel

Step 6: Track Usage Depth

Send events for key product actions. Apex uses these to compute usage-based PQL scores:

// Behavioral usage — client or server is fine.
track("feature_used", { feature: "export_report" });

Plan changes are revenue truth — emit them server-side (ideally from your Stripe webhook handler) so they're tamper-proof and deduped:

await sendServerEvent(
  { apiKey: process.env.APEX_API_KEY, workspaceKey: "YOUR_WORKSPACE_KEY" },
  { type: "subscription_event", visitorId: apexVid, data: { action: "started", product_id: "pro_annual" } },
  { idempotencyKey: stripeEvent.id },
);

Step 7: Track Lifecycle Transitions

When a user's lifecycle stage changes, record the transition:

await fetch("/api/contacts/{contactId}/lifecycle", {
  method: "POST",
  body: JSON.stringify({
    stage: "activated",
    trigger: "completed_onboarding",
  }),
});

Apex tracks every transition with timestamps, enabling time-to-activate analysis and cohort retention.

What You'll See

Once events flow in, your Apex dashboard shows:

  • Activation dashboard — signup-to-activation funnel, cohort activation rates, time-to-activate distribution
  • Retention dashboard — cohort retention matrix, churn rate trends, net revenue retention
  • PQL scores — each contact scored on activation, usage depth, expansion signals, and retention
  • Experiments — A/B tests evaluated by activation rate and usage, not just clicks

Next Steps