Measure referral quality, not just invites

Track invite sent, invite accepted, activation, and retention so product teams know whether referrals create valuable users.

Published

difficulty intermediate · time to value 5 minutes

Start from this

Analyze referral quality: invites sent, accepted, activated, and retained users by inviter cohort and channel.

Why this matters

Referral programs can inflate signup volume without producing retained users. Quality matters more than invite count.

What you get

  • Invite send and acceptance rates
  • Activation and retention of referred users
  • Best inviter cohorts and channels
  • Whether referral rewards are attracting quality users

Walk through it

You

Are referrals bringing good users?

Agent

I’ll follow referred users from invite to activation.

Endpoint: POST /v1/projects/:project_id/analytics/query
Exact shape: /v1/openapi.json?path=%2Fv1%2Fprojects%2F%7Bproject_id%7D%2Fanalytics%2Fquery&method=post
Custom HogQL goes in the OpenAPI-defined `query` field.
Concept fields:
  query: "SELECT properties.channel AS channel, countIf(event = 'referral_invite_sent') AS sent, countIf(event = 'referral_invite_accepted') AS accepted, countIf(event = 'activated') AS activated FROM events WHERE event IN ('referral_invite_sent','referral_invite_accepted','activated') AND timestamp > now() - INTERVAL 60 DAY GROUP BY channel ORDER BY accepted DESC"

The output

The agent returns referral channels and inviter cohorts ranked by activation quality.

Setting it up

Emit referral lifecycle events with stable inviter and invitee identifiers. Preserve referral source onto activation.

Variations

  • “Show referrals by power-user cohort.”
  • “Find inviters whose referrals activate above average.”
  • “Publish referral quality by channel.”

Adapt this playbook in your own agent.

Ask your agent to map the starter prompt to your saved signal map, live events, and the current HTTP API before answering.

Set up Agentry in this repo by following https://agentry.sh/install.md. I authorize you to: run its device-code login and save the key to ~/.agentry/credentials.json, read this repo, propose an instrumentation plan for my approval, and edit code after I approve it.

+ Full access
5.5 Extra High
  1. 1. Open your repo in Codex, Claude Code, Cursor etc.
  2. 2. Paste the install prompt.
  3. 3. Your agent reads the install doc and shows you an implementation plan for approval.