Skip to content

Use the hub's own GA4 property and track visits across team sites - #62

Closed
jsshin2022 wants to merge 1 commit into
mainfrom
hub-ga-crosslink
Closed

jsshin2022 wants to merge 1 commit into
mainfrom
hub-ga-crosslink

Conversation

@jsshin2022

Copy link
Copy Markdown
Member

Status

Review Required

Description

허브 전용 GA4 속성(G-C5V0X2SGD3)으로 바꾸고, 허브와 웹북 사이를 오가는 흐름을 양쪽 GA에서 볼 수 있게 했습니다. 웹북 쪽 짝은 CausalInferenceLab/Causal-Inference-with-Python#91입니다.

GA4

  • index·article·404 페이지 태그를 #59의 웹북 ID(G-BEBVKYH8HL)에서 허브 ID(G-C5V0X2SGD3)로 교체
  • 공통 스크립트 assets/js/track.js 추가(세 페이지 모두 로드)

허브 → 팀 사이트(웹북, causal-studio 등)

  • 같은 도메인의 팀 사이트 링크를 누르면 utm_source=hub&utm_medium=referral&utm_campaign=crosslink&utm_content=<누른 곳>을 붙여 이동 → 웹북 GA에서 '허브에서 온 방문'과 어느 자리에서 눌렀는지(featured, station, partner, curriculum, article, footer)가 보입니다
  • 이벤트: 웹북이면 webbook_click, 그 밖의 팀 사이트면 team_site_click (site, placement)
  • 팀 사이트는 한 가족처럼 같은 탭에서 열리도록 바꿈. Ctrl/⌘·가운데 클릭은 그대로 새 탭

웹북 → 허브

  • 웹북에서 온 utm_*는 page_location으로 GA에 넘긴 뒤 주소창에서 지움(공유되는 주소는 깔끔하게)
  • 역 정보 창을 열면 station_open (repo, level, 링크로 열었는지 from_link)

머지 후 GA 관리 화면에서 할 일 (두 속성 모두)

  • 맞춤 정의 → 이벤트 범위 맞춤 측정기준: placement, site, repo 등록(보고서에서 자리별로 보려면 필요)

#station= 링크로 열기 → 웹북 버튼 클릭 → 같은 탭에서 utm이 붙은 웹북 주소로 이동하는 흐름을 로컬에서 확인했고 콘솔 오류 없습니다.



Generated by Claude Code

The pages now load G-C5V0X2SGD3. Links to the team's other sites on
this domain open in the same tab, carry utm_source=hub with the spot
they were clicked from, and send webbook_click or team_site_click.
Incoming utm_* are read through page_location and then dropped from
the address bar. Opening an entry sends station_open.

Copy link
Copy Markdown
Member Author

Superseded by #63: same change rebuilt on current main (this branch conflicted with the shared ga.js/track.js from #61). Closing.


Generated by Claude Code

@jsshin2022 jsshin2022 closed this Oct 24, 2026
auto-merge was automatically disabled October 24, 2026 04:41

Pull request was closed

@jsshin2022
jsshin2022 deleted the hub-ga-crosslink branch October 25, 2026 12:47
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.

2 participants