Skip to content

feat(docs): add PostHog web analytics#208

Merged
rhuanbarreto merged 5 commits intomainfrom
feat/posthog-docs-analytics
Apr 14, 2026
Merged

feat(docs): add PostHog web analytics#208
rhuanbarreto merged 5 commits intomainfrom
feat/posthog-docs-analytics

Conversation

@rhuanbarreto
Copy link
Copy Markdown
Contributor

Summary

  • Initialize PostHog via the posthog-js SDK inside docs/src/components/HeadSEO.astro, alongside the existing Cloudflare beacon.
  • Traffic is routed through the managed reverse proxy at https://n.archgate.dev, with ui_host set to https://eu.posthog.com so PostHog dashboard deep-links resolve correctly.
  • Uses person_profiles: "identified_only" and the 2026-01-30 defaults.

Test plan

  • bun run build succeeds in docs/ and the generated HTML references the bundled HeadSEO script, which contains the PostHog init call.
  • After deploy to cli.archgate.dev: confirm posthog is defined on the page, events reach the EU PostHog project, and n.archgate.dev shows the expected proxy traffic.

🤖 Generated with Claude Code

rhuanbarreto and others added 3 commits April 14, 2026 12:21
commitizen/cz-cli is flagged as abandoned by Renovate. Replace it with
czg — a lightweight, zero-dependency conventional-commits CLI that reads
commitlint config natively.

- Remove commitizen, @commitlint/cz-commitlint, inquirer
- Add czg 1.12.0
- Update commit script from "cz" to "czg"
- Delete .czrc (czg reads .commitlintrc.json directly)
Initialize PostHog via the posthog-js SDK inside the existing
HeadSEO.astro override, alongside the current Cloudflare beacon.
Traffic is routed through the managed reverse proxy at n.archgate.dev,
with ui_host pointing back to eu.posthog.com so dashboard deep-links
resolve correctly.

Only identified users get profiles (person_profiles: identified_only)
and the 2026-01-30 defaults are used for up-to-date capture behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Apr 14, 2026

Deploying archgate-cli with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9132718
Status: ✅  Deploy successful!
Preview URL: https://0c5f65dc.archgate-cli.pages.dev
Branch Preview URL: https://feat-posthog-docs-analytics.archgate-cli.pages.dev

View logs

rhuanbarreto and others added 2 commits April 14, 2026 15:01
Oxlint 1.59 now scans .astro files when they contain a typeless
<script> block, and then treats the whole file as JavaScript — which
fails on the JSX-like template expressions in HeadSEO.astro (e.g.
{breadcrumbLd && (...)}).

Move the bundled PostHog <script> into its own Analytics.astro
component (pure <script>, no template logic) and render it from
HeadSEO.astro. Behaviour is unchanged — same SDK, same proxy, same
bundled asset in the final build.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rhuanbarreto rhuanbarreto enabled auto-merge (squash) April 14, 2026 13:20
@rhuanbarreto rhuanbarreto merged commit 0502ecd into main Apr 14, 2026
9 checks passed
@rhuanbarreto rhuanbarreto deleted the feat/posthog-docs-analytics branch April 14, 2026 13:24
@github-actions github-actions bot mentioned this pull request Apr 14, 2026
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