Capture Attribution
Persist the visitor's first-touch acquisition source at sign-in so signups can be attributed to a channel (paid ad, programmatic SEO, referral, organic search, or direct). Without this, ad/SEO links carry utm_source / er_src but nothing records them, making paid spend impossible to measure.
When the client has no stored attribution (cleared storage, second device), the source is derived server-side from the X-ER-Src header / er_src cookie / Referer, so the row always gets at least 'direct' — never NULL.
Writes use DB-level first-touch semantics (see _write_attribution): a real channel label is never overwritten by a later 'direct', fixing the second-device downgrade path. Idempotent per user via the service-role key (bypasses RLS). Best-effort — attribution never blocks the user.
Request
- Base URL: https://api.equity-rank.com (the document declares no server; this is the origin it was published from)
- URL: https://api.equity-rank.com/api/auth/capture-attribution
- Auth: HTTP bearer
Request body
Response
Successful Response
Changes
No recorded changes to this operation across all 1 revision of this API.