Skip to content

feat: PostHog on the docs, through a same-site /relay proxy - #67

Merged
OrestTa merged 1 commit into
mainfrom
feat/posthog
Sep 23, 2026
Merged

OrestTa merged 1 commit into
mainfrom
feat/posthog

Conversation

@OrestTa

@OrestTa OrestTa commented Sep 23, 2026

Copy link
Copy Markdown
Member

Why: the t1 docs had only Google Analytics, which ad blockers drop, and nothing we could use for session replay or error tracking.
What: loads PostHog (new project "t1", id 624862, shared with t1protocol.com) through a same-site /relay Netlify proxy. The landing page reuses that proxy, because Firebase Hosting cannot proxy itself.

Changes

  • docusaurus.config.mjs: a headTags script that loads the PostHog snippet with api_host: location.origin + "/relay" (so deploy previews use their own relay), captures page views on client-side navigation, and captures exceptions. It doesn't run on localhost.
  • netlify.toml: /relay/static/* proxies to us-assets.i.posthog.com and /relay/* to us.i.posthog.com, the same rules amplifi's app uses.

How to test

On the deploy preview, open DevTools → Network: /relay/static/array.js and /relay/e/ should return 200, with nothing going to posthog.com. Events appear in https://us.posthog.com/project/624862 with the preview's $host.

yarn build passes, and build/index.html contains the snippet.

User prompts

  1. "i did 1 and 2 and 3 - finalise everything\n\nalso quickly add posthog instrumentation to the t1 landingpage and t1 docs"

🤖 Generated with Claude Code

Loads PostHog (project "t1", id 624862) from a head script and sends it
through /relay, a Netlify proxy to PostHog, so ad blockers see a request
to docs.t1protocol.com. The same proxy serves t1protocol.com, which
Firebase Hosting cannot proxy itself. Skipped on localhost.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@netlify

netlify Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for t1docs ready!

Name Link
🔨 Latest commit c1c70a6
🔍 Latest deploy log https://app.netlify.com/projects/t1docs/deploys/6ab40ab9c8404800085973c0
😎 Deploy Preview https://deploy-preview-67--t1docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@OrestTa
OrestTa merged commit f15fa9e into main Sep 23, 2026
7 checks passed
@OrestTa
OrestTa deleted the feat/posthog branch September 23, 2026 17:52
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