GUIDE12 MIN READUPDATED Oct 12, 2026

ANALYTICS AND EVENT TRACKING IMPLEMENTATION GUIDE

How to instrument product analytics properly: choose PostHog, define an event taxonomy, track every growth loop, and build dashboards around one north star metric.

T

The Assignment Bot Team

Oct 12, 2026 · Editorial

Every growth program needs a measurement layer underneath it. This guide is the developer-ready spec for instrumenting product analytics across all six growth loops, a north star metric, the full AARRR funnel, and the dashboards that make the numbers actionable.

Pick PostHog as the Primary Product Analytics Tool

The core requirement is server-side attribution for every credit-affecting event. Compare the candidates on that: PostHog has a first-class Node SDK and server-side event ingestion; Mixpanel also does, but lacks built-in feature flags and session replay; GA4 relies on the Measurement Protocol and is client-only, sampled, and limited on funnels and cohorting. For a product where money and credits move based on server events, PostHog wins.

  • ▸Server-side event ingestion via the Node SDK — the trusted source
  • ▸Native multi-step funnel analysis with property breakdowns
  • ▸Native cohort retention by any property (signup week, course)
  • ▸Built-in feature flags — the kill-switch and A/B test platform
  • ▸Session replay for debugging the activation flow
  • ▸Generous free tier at early stage

Dual-Tracking: PostHog + GA4

The architecture is dual-tracking with a clear split. PostHog receives all product events, client and server, and is the source of truth for funnels, cohorts, retention, and growth loops. GA4 retains its existing event set — signup, purchase, generation start/complete/fail, CTA clicks — plus UTM tracking, and remains the marketing channel attribution tool. No new GA4 events are needed; the migration is additive, not a rip-and-replace.

On the client, initialize posthog-js with autocapture off (track explicitly, no noise) and page view capture on. On the server, create a PostHog Node client and always attach a source: server marker so trusted events are distinguishable from advisory client events. Identity resolution is standard: anonymous users get an ID from a cookie, signup calls identify() to merge the anonymous session into the identified user, and all subsequent server events use the user ID.

Event Taxonomy Standards

Consistent naming makes analytics queryable. Use snake_case and past tense for completed actions (assignment_completed, not complete_assignment). Prefix by domain — referral_, template_, group_, output_, search_ — and suffix by action type — _viewed, _clicked, _started, _completed, _sent, _saved, _awarded.

Every event carries universal properties: the distinct ID, session ID, current URL, source (client or server), timestamp, app version, and platform. User properties set at identify time include email, signup date and week (for cohorts), referral code and campaign, first completion timestamp, activation status, total completions, credits purchased, wallet balance, device type, and primary course.

Track Every Growth Loop

Each growth loop gets its own event set with a trigger, a fired-by source, and key properties. The important pattern is server-only enforcement: credit-affecting events are never accepted from the client. The advisory client endpoint whitelists only a handful of non-sensitive events; any client attempt to send a server-only event name logs a fraud-flagged event.

Loop 1: Classmate Referral

  • ▸referral_cta_viewed and share_sheet_opened — client, advisory
  • ▸share_sent — server, with referral code, campaign, channel, and IP hash
  • ▸invite_clicked — server, when a valid ref parameter is hit
  • ▸invitee_signup — server, when the invitee creates an account
  • ▸invitee_first_completion — server, with fraud decision
  • ▸credit_awarded — server, with milestone, amount, and idempotency key
  • ▸fraud_flagged — server, with the rule that fired and evidence

Loop 2: Output Share

The completed DOCX is the shareable artifact. Track share card views, forwards by channel, preview opens, downloads, and secondary signups. Put a referral URL in the subtle branding footer so a forwarded document becomes a trackable invite — unifying the output loop with the referral loop's attribution.

Loop 3: Deadline Content (SEO)

Track SEO page views, content-to-product CTA clicks, organic signups attributed to search, return visits, and paid purchases attributed to SEO. Cross-reference with GA4's Search Console integration for keyword-level data, since PostHog has no keyword-level search data.

Loop 4: Saved Templates

Templates reduce repeat friction. Track save prompts, saves, reuse starts, reuse completions (and compare completion time against non-template runs), fast re-runs, and course preset selections.

Loop 5: Group Workflow

Track group invite CTA views, invites sent, clicks, member signups, member completions, and repeat usage. A group is a derived concept — two or more invitees from the same referrer completing within 7 days for the same course — queried from completion events rather than tracked as its own event.

Loop 6: Word of Mouth

Organic word of mouth cannot be product-activated, only measured indirectly. Capture it through an attribution survey on signup (how did you hear about us?) and a post-completion satisfaction rating. A composite shareability score — high rating plus a forward within 24 hours — predicts whether a user is likely to recommend the product organically.

The WCASD North Star Metric

The north star is Weekly Completed Assignments with Successful Delivery. An assignment counts when it enters the workflow, completes processing successfully, reaches a usable DOCX export, and is delivered without a failure requiring manual recovery.

Implement it as a single PostHog trends insight: the count of docx_export_success events per ISO week, filtered to source = server. The export event is the terminal signal because it only fires when all three upstream conditions are met. Pair it with input metrics — upload-to-processing conversion, processing success rate, DOCX export rate, 30-day repeat rate, and referral share rate — plus an anomaly alert if weekly WCASD drops more than 20% week over week.

Build the AARRR Funnel

The classic funnel becomes five PostHog funnels with property breakdowns and conversion targets:

  • ▸Acquisition: landing_page_viewed to cta_clicked to signup_completed (9-13% landing-to-signup in month 1)
  • ▸Activation: signup to upload to processing started to processing completed to docx_export_success (with a 30-minute funnel window — the under-10-minute product goal is the target)
  • ▸Retention: cohort retention by signup week with docx_export_success as the returning event (10-15% 30-day repeat in month 1)
  • ▸Revenue: signup to first export to credit_purchased (8-14% free-credit-to-paid in month 1)
  • ▸Referral: share_sent to invite_clicked to invitee_signup to invitee_first_completion (20-30% invite-to-signup in month 1)

Dashboards and Cohorts

Create one saved cohort for activated users, repeat users within 30 days, template users, referral users, and paid users. Then build one dashboard per growth loop plus an executive overview carrying the ten widgets that matter: WCASD trend and growth, activation rate, processing success rate, paid purchases, share rate, invite conversion, 30-day repeat, traffic by channel, and the anomaly alert.

Implementation Order

  1. 1Install posthog-js on the frontend and posthog-node on the backend
  2. 2Create the typed tracking helper libraries with a single source of truth for event names
  3. 3Instrument the core cross-loop events first — they power the funnel and the north star
  4. 4Instrument the referral loop events next — the P0 blocking build
  5. 5Instrument the remaining loops as each loop's features ship
  6. 6Set up the insights, dashboards, saved cohorts, and the WCASD anomaly alert
  7. 7Keep GA4 live and unchanged — PostHog starts fresh from go-live
  8. 8Verify end to end with two test accounts completing the full referral flow
✓

The server-trust rule

Client-side events are advisory. Credit-affecting events must be server-side only, or your referral and retention numbers become gameable by anyone who opens the network tab.

→

Measure a product worth measuring

Analytics only tell you what to fix if the pipeline delivers. Generate a real assignment with real execution and real screenshots in 10 minutes — then instrument around it. First assignment is free.

ABOUT THE AUTHOR

The Assignment Bot Team — We test, write, and ship practical guides for CS students who want to spend less time formatting and more time learning.

READY TO SHIP YOUR LAB REPORT?

Skip the formatting. Upload your brief, get a complete, submit-ready DOCX in 10 minutes. First assignment is free.