Skip to content

feat(analytics): tag cross-site links with UTMs for source attribution#555

Merged
the-data-viking merged 1 commit into
mainfrom
claude/cross-site-session-linking-itscsq
Jun 27, 2026
Merged

feat(analytics): tag cross-site links with UTMs for source attribution#555
the-data-viking merged 1 commit into
mainfrom
claude/cross-site-session-linking-itscsq

Conversation

@the-data-viking

Copy link
Copy Markdown
Collaborator

What changed

Appends a cross-site link decorator to the PostHog snippet in site/_worker.js: outbound links to sibling DataViking properties (dataviking.tech, synthbench.org, traitprint.com) get utm_source=synthpanel&utm_medium=referral&utm_campaign=cross-site. Internal, non-sibling, and already-tagged links are left alone.

Why

The DataViking properties report to separate PostHog projects on separate cookie domains, so cross-site referrals can't be session-stitched natively. UTM source tags let each destination attribute the referral even when the HTTP referrer is stripped (the common case for cross-origin navigations). Part of the Tier-0 cross-site source-attribution effort.

Type of change

  • Feature

Test plan

  • The worker injects the snippet into the HTML <head> only; the decorator runs client-side at DOMContentLoaded. Worker build/deploy is exercised in CI.

Semver impact

  • semver:skip — change is to the marketing-site worker (site/_worker.js), not the published synth_panel Python package.

Checklist

  • Tests added or updated — N/A (inline worker snippet)
  • ruff check src/ tests/ passes — N/A (no Python changed)
  • mypy src/synth_panel/ passes — N/A (no Python changed)
  • CHANGELOG.md updated — N/A (not a package-visible change)

🤖 Generated with Claude Code

https://claude.ai/code/session_01PTupdVrN9mfou6zYfHqrqX


Generated by Claude Code

Append a link-decorator to the worker-injected PostHog snippet that stamps
outbound links to sibling DataViking properties (dataviking.tech,
synthbench.org, traitprint.com) with canonical utm_source/medium/campaign
params. Covers the hand-authored static HTML (blog, recommended-models)
without per-link edits.

Each property is a separate PostHog project on a separate cookie domain, so
sessions can't be stitched natively; UTMs let each destination project
attribute inbound referrals from its siblings.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaQWhEdJrx2uKvQst7f3fe
@the-data-viking the-data-viking enabled auto-merge (squash) June 27, 2026 21:44
@the-data-viking the-data-viking disabled auto-merge June 27, 2026 22:48
@the-data-viking the-data-viking merged commit 8ea8209 into main Jun 27, 2026
19 checks passed
@the-data-viking the-data-viking deleted the claude/cross-site-session-linking-itscsq branch June 27, 2026 22:48
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