Skip to content

feat(analytics): add first-party events and Vitals dashboard v2 - #144

Open
Adedoyinjr wants to merge 14 commits into
wraith-protocol:developfrom
Adedoyinjr:format/analytics-vitals-133
Open

feat(analytics): add first-party events and Vitals dashboard v2#144
Adedoyinjr wants to merge 14 commits into
wraith-protocol:developfrom
Adedoyinjr:format/analytics-vitals-133

Conversation

@Adedoyinjr

Copy link
Copy Markdown

Summary

  • add privacy-safe, typed first-party analytics events
  • ensure analytics respects DNT/GPC and no-ops when Plausible is unavailable
  • add exact-once event instrumentation for CTA, newsletter, blog reads, calculator sharing, chain sorting, and outbound links
  • upgrade /vitals with page and locale filters, conversion tiles, and 30-day incident status
  • document analytics events, payloads, retention, endpoint, and privacy behavior
  • harden analytics SSR behavior
  • restore the /ecosystem route and fix related test regressions

Validation

  • pnpm install --frozen-lockfile
  • pnpm format:check
  • pnpm test ✅ — 18 files, 134 tests
  • pnpm build
  • Analytics Playwright ✅ — 5/5
  • Lighthouse Performance ✅ — 100
  • Lighthouse SEO ✅ — 100
  • /vitals page filter ✅
  • /vitals locale filter ✅
  • conversion tiles ✅
  • 30-day incident overlay / empty state ✅
  • /blog/wave-7-kickoff 80% exact-once tracking ✅

Fixes #133

kilo-code-bot Bot and others added 13 commits August 26, 2026 09:57
Introduce a new tracking utility to capture user interactions and
implement tracking across various components and pages.

- Add `src/utils/track.ts` for event tracking logic
- Add `src/utils/track.test.ts` for utility testing
- Track CTA clicks in `CtaStrip` and `Hero` components
- Track blog post views in `Blog` page
- Track newsletter subscription attempts and successes in `Newsletter` page
…elemetry

Refactor the analytics implementation to use a centralized, type-safe
tracking utility that respects Do-Not-Track (DNT) and Global Privacy
Control (GPC) settings.

Key changes:
- Implement `trackOutbound` helper to categorize and track external
  link clicks (github, docs, social, etc.).
- Add scroll-depth based tracking for blog post reads (80% threshold)
  with exactly-once execution guards.
- Add submission guards to the newsletter form to prevent duplicate
  telemetry on rapid clicks.
- Standardize CTA event payloads across the site (Hero, Stellar,
  Ecosystem, etc.).
- Add an Analytics event schema documentation section to the Privacy
  page.
- Update Web Vitals dashboard to support locale-based filtering using
  synthetic fixture data.
- Add E2E tests for analytics event triggering and DNT suppression.
@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

@github-actions[bot] is attempting to deploy a commit to the truthixify's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Aug 26, 2026

Copy link
Copy Markdown

@Adedoyinjr Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@truthixify truthixify left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Adedoyinjr. The analytics work itself looks reasonable, but I cannot merge this while it adds .github/workflows/format-analytics-133.yml.

That workflow triggers on pushes to format/analytics-vitals-133, runs prettier over a hardcoded file list, then commits and pushes back to the branch under permissions: contents: write. It reads as scaffolding you used to fix formatting on your own branch, which is fine as a local trick, but merged into develop it would:

  • sit in the repo permanently, triggering on a branch that will not exist after this merges
  • keep a standing contents: write auto-committing workflow in the repo for no ongoing purpose

Please delete that file from the PR and run prettier locally instead:

pnpm exec prettier --write .
git commit -am "style: format"

Two smaller notes while you are in there. index.html is modified at +22/-15, worth a look that nothing unrelated to analytics crept in. And no build check has reported on this PR at all, so once the workflow file is gone please confirm CI actually runs.

@Adedoyinjr

Copy link
Copy Markdown
Author

Thanks @truthixify. I’ve removed ".github/workflows/format-analytics-133.yml" from the PR.

I also reviewed "index.html"; the remaining changes there are directly related to the analytics/privacy work, specifically gating Plausible behind DNT/GPC.

The normal repository CI is configured for PRs into "develop", but no GitHub Actions run has started yet for the latest commit. Please let me know if the workflow needs maintainer approval for this fork PR.

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.

First-party analytics events + Vitals dashboard v2

2 participants