Skip to main content
Supabase Auth → AmplitudeIntegration guide

Connecting Supabase Auth to Amplitude

Supabase Auth sits directly on your own Postgres database, which means the identity and the revenue can be joined with a query rather than through an integration. Amplitude is built around behavioural cohorts, which makes the identity resolution and the event taxonomy load-bearing in a way they never are for an ad pixel. The join between them succeeds or fails on one thing: whether the user ID and device ID pair reaches the Supabase user before the conversion happens, because Amplitude can only match a conversion it can tie back to a click it recognizes.

Free30 minutesNo obligation

Specific to this pair

Supabase Auth and Amplitude: the auth UUID as Amplitude user_id

Call Amplitude's setUserId with the Supabase auth.users UUID when onAuthStateChange reports a sign-in, and use that UUID server-side too, never email. Send revenue from Postgres via a Database Webhook or scheduled Edge Function, with the invoice ID as insert_id so retries aren't double counted. Test that OAuth redirects keep the same device ID.

Amplitude needs one user ID that every event agrees on, and Supabase gives you a good one: the UUID in auth.users. Call setUserId with it in the browser when onAuthStateChange reports a sign-in. Amplitude then merges the pre-signup device ID with the account, and the landing-to-signup funnel holds together. Use the UUID in every server-side event too. If you use the email instead, a user who changes their email in Supabase splits into two Amplitude users.

Send revenue from the database, not from the browser. Because auth users and billing sit in the same Postgres instance, a Database Webhook or a scheduled Edge Function can read new paid invoices joined to the user and post them to Amplitude. Include the price and quantity fields, the user's UUID and the invoice ID as insert_id. That last part matters, because webhook retries are routine and Amplitude will otherwise count a retried invoice twice.

Check the OAuth path specifically. A visitor who clicks Sign in with GitHub leaves your domain and comes back. If the Amplitude SDK reinitializes on return before setUserId runs, the first post-login events land on a fresh device ID. Test the full redirect once with the network tab open and confirm that events before and after it share the same Amplitude device ID.

Supabase Auth → Amplitude · what breaks

Why this join usually fails — Supabase Auth → Amplitude

  1. 01

    The user ID and device ID pair never reaches Supabase Auth

    OAuth flows redirect off-site and back, which can lose an identifier captured before login.

  2. 02

    Building a pipeline for a join you could write in SQL

    Teams reach for a CDP or an event pipeline to connect identity to revenue when both tables sit in the same database. The simplest correct answer is usually a scheduled query.

  3. 03

    Revenue events that carry no revenue

    Amplitude will happily accept a purchase event with no price field. The event count looks correct, the funnel looks correct, and the revenue reporting stays at zero — which people usually discover a quarter later when someone asks what a cohort is worth.

  4. 04

    Nothing reconciles afterwards

    Amplitude shows the event in the user's activity stream with its properties expanded. Read the properties, because an event that arrives without its revenue fields still looks like a success.

Supabase Auth → Amplitude · the fix

What working looks like — Supabase Auth → Amplitude

  • The user ID and device ID pair on every account

  • Conversions arriving in Amplitude

    The event lands on the user, joins their behavioural history, and becomes available for cohorts, funnels and retention.

  • Reconciled against the source

Supabase Auth → Amplitude · architecture

How Supabase Auth and Amplitude actually connect

  1. 1

    Supabase Auth holds the truth

    Because everything is in one Postgres instance, the join that most products build a pipeline for is a SQL statement here. That is a genuine advantage and it is frequently unused.

  2. 2

    Amplitude needs a click to match

    Amplitude needs a device or user identifier, an event type and its properties. Revenue events need the price and quantity fields specifically, or the revenue reporting stays empty while events flow normally.

  3. 3

    The identifier is the bridge

    The user ID and device ID pair, captured at the visit and carried into the Supabase user.

  4. 4

    The event source decides reliability

    Send paid conversions from a query joining auth users to billing.

  5. 5

    Deduplication at the destination

    Amplitude deduplicates on insert_id. Omit it and a retried batch is counted twice, which shows up as a phantom spike that someone will eventually build a hypothesis on.

Supabase Auth → Amplitude · normal or broken

Working vs. broken, side by side — Supabase Auth → Amplitude

Normal, not a fault

  • The user ID and device ID pair present on the account

  • Sent from your own database

  • Deduplicated correctly

    Amplitude deduplicates on insert_id. Omit it and a retried batch is counted twice, which shows up as a phantom spike that someone will eventually build a hypothesis on.

  • Reconciles with the source

Actually broken

  • The user ID and device ID pair missing on most records

    OAuth flows redirect off-site and back, which can lose an identifier captured before login.

  • Sent from the browser

    Teams reach for a CDP or an event pipeline to connect identity to revenue when both tables sit in the same database. The simplest correct answer is usually a scheduled query.

  • Counted twice, or not at all

    Amplitude will happily accept a purchase event with no price field. The event count looks correct, the funnel looks correct, and the revenue reporting stays at zero — which people usually discover a quarter later when someone asks what a cohort is worth.

  • Nobody has reconciled it

Supabase Auth → Amplitude · diagnose

Diagnostic order — Supabase Auth → Amplitude

  1. 01

    Count accounts carrying the user ID and device ID pair

  2. 02

    Follow one real conversion end to end

  3. 03

    Check whether identity and billing are in the same database

    If they are, most of the usual integration complexity is unnecessary.

  4. 04

    Check a purchase event for the price and quantity fields specifically

    Not whether the event arrived — whether the revenue fields are populated, in the exact names Amplitude expects.

  5. 05

    Read the match rate, not the success message

    Amplitude shows the event in the user's activity stream with its properties expanded. Read the properties, because an event that arrives without its revenue fields still looks like a success.

Supabase Auth → Amplitude · prove

How it gets proven — Supabase Auth → Amplitude

Source of truth

Your own database, joining the auth user to the subscription or order table.

  • The user ID and device ID pair confirmed present on a live account.
  • Revenue reconciled per transaction against your billing system, with identity merge behaviour verified across signup.
  • Paid conversions reconciled by query against imported conversions, with identifier survival verified across OAuth.

Supabase Auth → Amplitude · free audit

What we check in the free audit

  • Count accounts carrying the user ID and device ID pair
  • Follow one real conversion end to end
  • Check whether identity and billing are in the same database
  • Check a purchase event for the price and quantity fields specifically
  • Read the match rate, not the success message

Checked against

Your own database, joining the auth user to the subscription or order table.

Get my free conversion tracking audit

Free30 minutesNo obligation

Supabase Auth → Amplitude · when not to buy

When you don't need this — Supabase Auth → Amplitude

  • Measure identifier coverage yourself first — pull your last hundred accounts and count how many carry the user ID and device ID pair.
  • If billing lives in a separate system, the join is a real integration again and the advantage disappears.
  • If nobody is building cohorts or retention analysis, this is a large amount of instrumentation for reporting a dashboard already gives you.

Supabase Auth → Amplitude · what we deliver

What gets built — Supabase Auth → Amplitude

  • Identifier capture into Supabase Auth

    Persist the identifier before the OAuth redirect and write it onto the user row at first login, where it is then permanently queryable.

  • Event source: your own database

    Send paid conversions from a query joining auth users to billing.

  • Dispatch to Amplitude

    The Amplitude HTTP V2 API, posted server-side with the identity, event type and properties.

  • Reversals where they exist

    Cancellations reverse against the same user row.

Written guarantee

95%+ tracking accuracy

Measured against Your own database, joining the auth user to the subscription or order table.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Supabase Auth → Amplitude questions, answered

The auth.users UUID, set with setUserId at sign-in and used on every server-side event. Email changes, the UUID doesn't.

Free · 30 min

Get Supabase Auth and Amplitude joined properly

Free30 minutesNo obligation