Repository navigation
feat(ads): keep every ad click a contact comes from - #1558
Merged
Merged
Conversation
viethung0o0
force-pushed
the
feat/contact-ad-referral-history
branch
2 times, most recently
from
October 28, 2026 03:56
1952127 to
c2ba52c
Compare
Contacts used to keep only their latest ad. Every click is now stored, so contacts can be listed and filtered by any ad they clicked, and conversions point to the click they came from. - add an append-only ContactReferralEvent log written from the one place that updates the referral snapshot - show the ad history on the contact profile and add it to the public API - add the Clicked ad contact filter and the ad_ids and ad_id system fields - add per-ad contacts, first touch and credited conversions to the Ads dashboard
viethung0o0
force-pushed
the
feat/contact-ad-referral-history
branch
from
October 28, 2026 08:17
c2ba52c to
25e3349
Compare
viethung0o0
marked this pull request as ready for review
October 28, 2026 08:29
hello-jackytruong
referenced
this pull request
in hello-jackytruong/ChatWorkAI
Nov 22, 2026
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.
Summary
Changes
ContactReferralEventtable with one row per click (WhatsApp, Messenger, Instagram and Zalo Google clicks). Retries do not create duplicates and organic referrals are skipped.{{ad_ids}}and{{ad_id}}(first ad).contacts.listAdReferrals,ads.listReferralAdsandads.referralStats. CLI docs updated.Test plan
pnpm --filter @chatbotx.io/database db:migrate) before deploying the app