Product Intelligence

Setup with AI Coding Assistants

Use an AI coding assistant to instrument your app with ThriveStack product telemetry in minutes.

Claude Lovable Replit Bolt.new OpenAI Codex Google AI Studio Antigravity Emergent Windsurf and more

What you need

Engineer with access to all product codebases One or more repos covering your user lifecycle and product features

How does it work?

Paste a single prompt into your AI coding assistant. The AI reads your codebase, asks a few clarifying questions, instruments every user lifecycle and feature event, and produces a verified 12-point checklist — all in about 2 minutes.

Step 0: Concepts

  • Got a split codebase? If your signup, login, or feature flows live across multiple repos or a separate backend service, read the Multi-Repo & Split Flows guide before running the prompt.
  • Understand event telemetry. Review the event taxonomy and lifecycle-to-event mapping so you know which product actions emit track, identify, and group calls. Read Events Telemetry.
  • Environments and API Keys. Ensure product and marketing streams use the same environment key so data lands in the same workspace and correlation is possible. Read Environments and API Keys.
  • Why Correlation Matters. Understand how shared group_id joins product usage with billing outcomes to unlock churn and expansion signals. Read Why Correlation Matters.

Step 1: Get your API key

Create / Reuse your API Key

Step 2: Copy the Prompt

Loading...

Step 3: Run it — what to expect

Open your repo in your AI coding assistant, paste the prompt, and run it. The AI follows a structured 5-phase process and stops to ask you questions before writing any code. Here's exactly what happens:

0
Phase 0 — Codebase scan & three questions

The AI reads your codebase, identifies your tech stack, auth library, and all instrumentable features. It then asks you three things before writing a single line:

  1. B2B or B2C? — Do users belong to accounts/organizations, or is each user their own account?
  2. Feature classification — For every feature found: is it core (primary value driver), sticky (habit-forming), or support (switching cost)?
  3. Abuse email check — Should disposable/fake signup emails be blocked, flagged, or ignored?
1
Phase 1 — Script tag

Adds the ThriveStack SDK to your root layout once — never inside a component or page. Writes your API key to the appropriate .env file.

2
Phase 2 — Lifecycle events

Instruments identify, group, signed_up, signed_in, signed_out, account_created, account_added_user, onboarding_step_completed, and invite_sent — in the correct firing order for every auth flow found in your codebase.

3
Phase 3 — Feature events

Adds one feature_used call per confirmed feature action, using the feature_type you provided in Phase 0.

4
Phase 4 — 12-point verification summary

The AI audits every instrumentation point and outputs a structured checklist directly in the chat. Every row shows ✅ implemented, ⚠️ partial, or ❌ missing — with the exact file and handler used.

The output you'll receive

# Event / Check Status Notes
0 script tag URL ✅/⚠️/❌ Exact src used
1 identify ✅/⚠️/❌ Field used, file
2 group ✅/⚠️/❌ Entity levels, billing root
3 signed_up ✅/⚠️/❌ Handler, file
4 signed_in ✅/⚠️/❌ Handler, file
5 account_created ✅/⚠️/❌ Handler, file or N/A
6 account_added_user ✅/⚠️/❌ Entry points covered
7 feature_used ✅/⚠️/❌ Features and their feature_type
8 invite_sent ✅/⚠️/❌ Handler, file or N/A
9 onboarding_step_completed ✅/⚠️/❌ Steps found or N/A
10 signed_out ✅/⚠️/❌ Handler, file
11 abuse_check ✅/⚠️/❌ block / flag / N/A

Step 4: Confirm events are firing from your app

This step confirms the code is instrumented correctly — that the SDK calls actually fire when a user signs up, logs in, or uses a feature. At the end of Phase 5, the AI will ask you which option you prefer:

A Manual testing — DevTools Network tab

Open DevTools → Network tab → filter by thrivestack. For each request, click it and verify the payload contains event_name, user_id, and context.group_id. Walk through each flow:

Signup

Register a new account. Expect: identify, group, signed_up, account_created, account_added_user — in that order.

Login & logout

Sign in with an existing account, then sign out. Expect: identify + signed_in on login; signed_out on logout.

Features

Use each instrumented feature. Expect one feature_used track call per action, with feature_name and feature_type in the payload.

Invitation

Send a team invite. Expect: invite_sent with invitee_email in properties. Then accept the invite as the invitee — expect signed_up + account_added_user with join_method: "invite".

Abuse prevention (if enabled)

Try signing up with a disposable email address (e.g. from mailinator.com). If block was chosen: the form should reject it. If flag was chosen: signup proceeds but the user is marked for review.

B AI-assisted testing — let the AI verify for you

Tell the AI your local dev URL (e.g. http://localhost:3000). The AI will open your app, walk through signup and login, inspect the network requests, and report back which events fired and which are missing — fixing any issues automatically.

Only available in AI coding assistants with browser capability (e.g. Cursor, Windsurf, Claude).


Step 5: Verify your setup in ThriveStack

Once events are confirmed firing, check your setup status and monitor the live event stream in ThriveStack.

What did you just achieve? 🎆

Traditional product Analytics tools try to sell you a platform to track clicks and events, but you have to setup and configure separately. With AI coding assistants, ThriveStack automatically instruments and verifies the entire setup

  • Various Product Analytics reports are now available. Refer your /home page to view the reports
  • Account level Analytics, including 40+ metrics across Activation, Product Usage are available in the Full Journey CRM
Feature Traditional Product Analytics ThriveStack Product Intelligence
Track events Manual Automatic
Track pages Manual Automatic
Track Growth events Manual Automatic
User Level Analytics
Account level analytics 40-50% surcharge Included
Full Bow-tie Journey Buy multiple analytics tools Included
Note: You'll also receive an email notification summarising all events logged and any issues to fix.