TK-34: Record Matomo Analytics in Production - #70
Merged
burkkyy merged 4 commits intoSep 5, 2026
Merged
Conversation
Why? The Matomo integration was already present but never recorded: the production build shipped with an empty tracker host, and the app's Content Security Policy blocked the external tracker script and beacons. Default the production tracker host to https://analytics.gov.yk.ca (still overridable via VITE_MATOMO_HOST) and allowlist it in the script-src and connect-src CSP directives. Non-production environments stay disabled. See https://yg-hpw.atlassian.net/browse/TK-34
burkkyy
marked this pull request as ready for review
September 5, 2026 04:07
burkkyy
deleted the
tk-34/have-matomo-analytics-code-integrated-for-website-analytics
branch
September 5, 2026 04:08
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.
Fixes https://yg-hpw.atlassian.net/browse/TK-34
Context
Matomo analytics were reported as not recording for the production Vault:
The Matomo tracking code was already integrated (SPA page-view tracking wired through the router), but it never recorded in production for two independent reasons:
VITE_MATOMO_HOST, which was not provided at build time, so the plugin no-opped.matomo.jsscript and thematomo.phpbeacons would have been blocked even once enabled.Implementation
VITE_MATOMO_HOST).Screenshots
N/A - configuration changes only.
Testing Instructions
dev test.dev up.Content-Security-Policyheader includeshttps://analytics.gov.yk.cain bothscript-srcandconnect-src.VITE_MATOMO_HOST=https://analytics.gov.yk.ca, load the app, navigate between pages, and verify in the browser Network tab thatmatomo.jsloads andmatomo.phprequests fire with no CSP violations in the console.