Skip to content

Add campaign pageview tracking and /github redirect - #78

Merged
suguanYang merged 1 commit into
mainfrom
feat/wangbinqi/campaign-route-pageview-tracking
Jul 24, 2026
Merged

Add campaign pageview tracking and /github redirect#78
suguanYang merged 1 commit into
mainfrom
feat/wangbinqi/campaign-route-pageview-tracking

Conversation

@suguanYang

Copy link
Copy Markdown
Contributor

Summary

  • Add marketing_page_views first-party tracking so repeat campaign visits (including UTM 404 paths like /reddit?utm_source=reddit) are counted even when a first-touch cookie already exists.
  • Expand acquisition capture to /github and any public path with UTM/oppref query params; provider captures session first, then pageview with the returned session id.
  • Ship a client /github redirect page to https://github.com/Ontos-AI/knowhere so GA and first-party tracking can fire before leave, and point the landing header GitHub link at /github.

Test plan

  • Visit /github and confirm brief redirect page, GA pageview, and a marketing_page_views row for /github
  • Visit /reddit?utm_source=reddit and confirm 404 UI plus session + pageview rows
  • Revisit a campaign URL with an existing kh_acquisition_session cookie and confirm pageviews still increment without overwriting first-touch session
  • Confirm /, /claw, /comparison/*, /versus/* still capture first-touch as before
  • Run pnpm db:migrate (or apply 0009_mushy_ezekiel) and acquisition attribution unit tests

Made with Cursor

Record raw marketing_page_views for repeat campaign visits (including UTM 404s), keep first-touch sessions intact, and ship a client /github redirect so GA and first-party tracking fire before leaving the site.

Co-authored-by: Cursor <cursoragent@cursor.com>
@suguanYang
suguanYang merged commit aa13d7b into main Jul 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant