From 229f99995c8035f45492986af0a297fd561adc82 Mon Sep 17 00:00:00 2001 From: Ray Clanan <115944+rclanan@users.noreply.github.com> Date: Fri, 16 Oct 2026 10:20:47 -0400 Subject: [PATCH] feat(marketing): add PostHog analytics with AI-referral tagging Load public/analytics.js (deferred) from the shared head block so every generated page gets it. It initializes PostHog cookieless, without session recording or input autocapture, and tags visits referred by AI assistants with an ai_referral_landing event and an ai_referrer super property. The committed file keeps an inert placeholder key; build:site injects POSTHOG_KEY from the environment and the deploy workflow passes the POSTHOG_KEY secret. The privacy page now describes the analytics, and the verify workflow runs the new node:test suite. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/deploy-pages.yml | 3 + .github/workflows/verify-pages-build.yml | 1 + 404.html | 1 + README.md | 13 + compare-mockserver.html | 1 + comparisons.html | 1 + contact.html | 1 + engineering-notes.html | 1 + faq.html | 1 + index.html | 1 + note-announcing-v1.html | 1 + ...drift-detection-and-contract-alerting.html | 1 + note-client-generation-tradeoffs.html | 1 + note-cloud-launch.html | 1 + note-conformance-maturity.html | 1 + note-conformance-testing.html | 1 + note-cost-cap-design.html | 1 + note-fault-injection-patterns.html | 1 + note-grpc-dynamic-routing-release.html | 1 + note-grpc-mocking-in-ci.html | 1 + note-migration-from-static-fixtures.html | 1 + note-mocking-kafka-without-broker.html | 1 + ...rget-conformance-and-real-world-specs.html | 1 + note-our-saas-infrastructure.html | 1 + note-release-cadence-and-risk.html | 1 + note-reliability-update-march-2026.html | 1 + ...ability-updates-conformance-and-admin.html | 1 + note-scenario-switching.html | 1 + note-security-guardrails-v0-2x.html | 1 + note-spec-driven-openapi-conformance.html | 1 + note-testing-failure-paths.html | 1 + note-v0-1-3-protocol-expansion.html | 1 + note-v0-2-0-client-generation.html | 1 + note-v0-2-3-bug-fixes.html | 1 + note-v0-2-4-client-fixes.html | 1 + note-v0-2-5-enterprise-security.html | 1 + note-v0-2-6-security-infrastructure.html | 1 + note-v0-2-7-api-sync-tcp.html | 1 + note-v0-3-227-release.html | 1 + note-v0-3-migration-playbook.html | 1 + note-vs-postman-mock.html | 1 + note-wafbench-security-hardening.html | 1 + note-wafbench-sqli-detection.html | 1 + note-wasm-plugins.html | 1 + note-when-wiremock-isnt-enough.html | 1 + note-why-multi-protocol.html | 1 + package.json | 3 +- pricing.html | 1 + privacy.html | 17 +- public/analytics.js | 227 ++++++++++++++++++ scripts/analytics.test.js | 188 +++++++++++++++ scripts/build-pages.js | 18 ++ src/pages/privacy.html | 16 +- support.html | 1 + trust.html | 1 + vs/beeceptor.html | 1 + vs/bruno.html | 1 + vs/microcks.html | 1 + vs/mockoon.html | 1 + vs/postman-mock.html | 1 + vs/wiremock.html | 1 + 61 files changed, 525 insertions(+), 13 deletions(-) create mode 100644 public/analytics.js create mode 100644 scripts/analytics.test.js diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml index 6756867..a572f8d 100644 --- a/.github/workflows/deploy-pages.yml +++ b/.github/workflows/deploy-pages.yml @@ -32,6 +32,9 @@ jobs: - run: npm ci - run: npm run build:css - run: npm run build:site + env: + # PostHog project key (public by design). Unset = analytics stays off. + POSTHOG_KEY: ${{ secrets.POSTHOG_KEY }} - uses: actions/upload-pages-artifact@v3 with: diff --git a/.github/workflows/verify-pages-build.yml b/.github/workflows/verify-pages-build.yml index a221093..507d8ac 100644 --- a/.github/workflows/verify-pages-build.yml +++ b/.github/workflows/verify-pages-build.yml @@ -22,5 +22,6 @@ jobs: - run: npm run build:css - run: npm run build:pages - run: npm run build:site + - run: npm test - run: npm run check:links -- --internal-only - run: git diff --exit-code diff --git a/404.html b/404.html index 971e8e3..7257490 100644 --- a/404.html +++ b/404.html @@ -17,6 +17,7 @@ +