Skip to content

feat(site): Count the campaign's steps with LVBT analytics - #11

Merged
WillieCubed merged 2 commits into
mainfrom
feat/lvwwd-analytics
Sep 24, 2026
Merged

WillieCubed merged 2 commits into
mainfrom
feat/lvwwd-analytics

Conversation

@WillieCubed

@WillieCubed WillieCubed commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

TL;DR

Add campaign analytics to lvwwd.org using LVBT's shared analytics package. The site counts a defined set of successful campaign actions without sending participant details, and respects Global Privacy Control and Do Not Track. Analytics are absent from builds until the production environment supplies the Cloudflare Web Analytics token.

Changes

Campaign actions are recorded where they succeed: sign-ups, link requests, trip entries, sharing, bingo progress, Find a bus, installs, printing, and views of the mail-in instructions. Calls go directly through the shared track API; repeated local wrappers have been removed. Event properties contain only campaign days, counts, or fixed labels. The privacy page explains the behavior.

The Astro integration adds the browser runtime when PUBLIC_LVBT_CWA_TOKEN is present. The deploy workflow passes that production environment variable to the build. Local and preview builds remain tokenless. The site's Content Security Policy allows the shared collector and Cloudflare beacon when analytics are enabled.

The browser test runs against a dedicated preview port and checks the beacon, event payload privacy, and Global Privacy Control. Production setup and verification steps are documented without account-specific dashboard links or ID callouts.

pnpm check passes, including 296 unit tests. The focused analytics browser tests pass (6/6). The full browser suite has two existing offline-notification test failures: those tests look for a checkbox no longer rendered by the current My week page.

GitHub Packages now grants this repository Read access to the private analytics package. The latest Validate check passes, including dependency installation, pnpm check, dependency audit, and secret scan.

Follow-ups and Next Work

  • Grant each new consuming repository Actions Read access to the analytics package when adopting it; GitHub does not grant cross-repository private package access automatically.
  • Create the lvwwd.org Web Analytics site and set PUBLIC_LVBT_CWA_TOKEN in the GitHub production environment. The integration remains off until that is done; live analytics have not been verified.
  • The public platform manifest still requires literal Cloudflare account and zone IDs under the current repository tooling contract. Removing those IDs from the repository requires a tooling change; changing dashboard links does not erase prior Git history.

Count campaign actions after successful steps. Respect browser
privacy signals and omit analytics from builds without a production
token. Simplify event calls and tests, and remove account-specific
Cloudflare dashboard links from public setup guidance.

Co-authored-by: Codex <noreply@openai.com>
Point maintainers to the organization package listing and the actual
settings path for granting consuming repositories Actions access.

Co-authored-by: Codex <noreply@openai.com>
@WillieCubed
WillieCubed merged commit 8fdc4b8 into main Sep 24, 2026
1 check passed
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