feat: record install attribution method and matched signals#32
Merged
Conversation
Make install attribution measurable. install_events gains attribution_method
('fingerprint' on a match, 'none' when organic) and matched_factors (the
fingerprint signals that matched — already computed by the matcher, now
persisted). Set in recordInstallEvent; idempotent ALTER for existing databases.
Adds scripts/backfill-attribution.ts (npm run backfill:attribution): one-time,
keyset-paginated backfill of attribution_method for historical rows from
whether they were attributed (link_id present); matched_factors stays NULL for
history.
Enables measuring attribution quality by method (fingerprint vs organic) and
auditing which signals drove each match. Verified: 139 unit tests pass; an
integration check confirms the columns, TEXT[] persistence, and the backfill.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What
Makes install attribution measurable by persisting how each install was attributed and which signals drove it.
install_eventsgainsattribution_method('fingerprint'on a match,'none'when organic) andmatched_factors TEXT[](the fingerprint signals that matched — already computed by the matcher, previously discarded). IdempotentALTERfor existing databases. [1] [2]recordInstallEvent(current install attribution is fingerprint-based, so the method is derived from whether a ≥threshold match was found). [1]scripts/backfill-attribution.ts(npm run backfill:attribution): one-time, keyset-paginated backfill ofattribution_methodfor historical rows from whether they were attributed (link_idpresent).matched_factorsstays NULL for history (the signals weren't stored). [1] [2]Why
Attribution confidence is only meaningful for fingerprint-matched installs; without a stored method, the confidence distribution mixes fingerprint and organic installs and can't be interpreted. This lets us measure attribution quality by method and audit which signals matched.
Verification
matched_factorsTEXT[] round-trips, and the backfill sets organic rows to'none'.