Repository navigation
Enable Brockville aggregate analytics (Kingston standard) - #17
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before: Brockville Food Help has analytics disabled (
"analytics": { "enabled": false }).After: Brockville sends Kingston's six established v3 aggregates to Lighthouse (
page_view,resource_call,help_211,directions,official_source,pwa_install), opt-out by default, with Kingston's labels and referrer rules. It sends no product signals (resource_open,install_prompt), by decision. It uses its own site keybrockville_food_help, preference keybfh-optional-analyticsand internal hostbrockville.food-help.ca. The disclosure drops Kingston's cross-domain sentence.How: only
deployments/brockville/site.jsonchanges; no generic code changes.tests/unit/brockville-analytics.test.tsmirrors the Kingston test: exact payloads and keys, signals inert, no first-visit preference write, no private context, Brockville-only key and host, a Kingston saved choice has no effect, and privacy, preview and page gates keep collection off.Lighthouse 1.36.0 (accepting
brockville_food_helpfrom this origin) and its tables are already live, and Agent Smith 0.33.0 reports it via/bfh.Checks:
tsc --noEmitand the worker typecheck are clean;npm run check -- --site deployments/brockvilleruns 78/78 unit and contract tests passing. Browser end-to-end tests were left to CI.Publication is a separate step: merging does not publish. Releasing
release/brockville(npm run release -- --site deployments/brockville --publish) is what turns collection on, and the first live page view is permanently counted. Rollback: setanalytics.enabledback to false and re-release.