Repository navigation
feat(auth): add privacy-conscious signup funnel measurement - #791
Merged
Merged
Conversation
Extend consent-gated first-touch attribution with coarse channel and sanitized landing path, and emit GA4 sign_up only after successful consented registration. Record durable set-once project telemetry receipt timestamps, backfill surviving historical evidence, and guard analytics_ro column grants behind role existence. Update privacy disclosures and cover classification, consent, and activation.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Extend merged first-touch signup attribution without replacing its cookie or consent mechanism. Store nullable User.signup_channel and User.first_landing_path; retain only the pathname and sanitized utm_source/utm_medium/utm_campaign query tags. Existing UTM fields and hostname-only referrer behavior remain. No browser persistence before consent; rejection deletes the cookie and the existing server action independently gates forwarding. Missing API attribution records no_consent with no landing/referrer/campaign values. Direct API attribution remains client-supplied and cannot prove consent.
After successful self-serve or invite registration, emit GA4 sign_up (method=email) only when existing consent is accepted and gtag is available. Failed registrations emit nothing. No additional tracking event, loader, public analytics endpoint, or identifier is introduced.
Add nullable Project.first_event_at, conditionally set once after accepted event, nonempty batch, new session, or error ingestion. One indexed conditional update per accepted request/batch, with no rewrite after activation. Retention leaves this project fact intact. Organization activation can be derived from the minimum project timestamp. Update privacy/cookie disclosures and reporting documentation.
Migration notes
Additive nullable columns only. Backfill earliest surviving Event.created_at, ErrorOccurrence.created_at through ErrorGroup, and Session.started_at; fall back to ApiKey.last_used_at only when raw evidence is absent. This fallback is approximate and may include non-ingest authentication. Already-retained-away history cannot be reconstructed exactly. Historical session timestamps are client-provided; future activation uses server receipt time. The backfill scans retained data and updates projects; account for database size during normal migration scheduling.
A pg_roles-guarded DO block grants analytics_ro SELECT only on the three new columns, and runs only when that role exists. No view was added; docs include independent daily stage queries. No migration, real database access, Railway action, merge, deployment or publish was performed.
Validation
Reporting limits
GA4 landing traffic is consented; server signup/project/activation facts include all operational activity. Daily stage totals are not visitor-level conversion cohorts. Missing attribution is not proof of refusal; blocked/unloaded GA drops sign_up. Configure sign_up as a GA4 key event separately after deployment.