feat(analytics): add first-party events and Vitals dashboard v2 - #144
feat(analytics): add first-party events and Vitals dashboard v2#144Adedoyinjr wants to merge 14 commits into
Conversation
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.
|
@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. |
|
@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! 🚀 |
truthixify
left a comment
There was a problem hiding this comment.
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: writeauto-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.
|
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. |
Summary
/vitalswith page and locale filters, conversion tiles, and 30-day incident status/ecosystemroute and fix related test regressionsValidation
pnpm install --frozen-lockfile✅pnpm format:check✅pnpm test✅ — 18 files, 134 testspnpm build✅/vitalspage filter ✅/vitalslocale filter ✅/blog/wave-7-kickoff80% exact-once tracking ✅Fixes #133