Skip to content

feat(docs): add Matomo analytics to documentation site#469

Open
marc0olo wants to merge 3 commits intomainfrom
feat/docs-matomo-analytics
Open

feat(docs): add Matomo analytics to documentation site#469
marc0olo wants to merge 3 commits intomainfrom
feat/docs-matomo-analytics

Conversation

@marc0olo
Copy link
Member

@marc0olo marc0olo commented Mar 26, 2026

Summary

  • Add Matomo analytics tracking to the docs site, matching the portal's configuration (cookies disabled, link tracking enabled, same Matomo Cloud instance, site ID 21)
  • The tracking script is deployed as a single root-level file (/matomo.js) so the site ID can be updated without rebuilding existing versioned docs
  • Every page includes <script src="/matomo.js" async> via Starlight's head config

After merging

  • All existing versioned builds (/0.1/, /0.2/, /main/) need a one-time rebuild to pick up the new <script> tag
  • Future site ID changes only require updating docs-site/matomo.js — no version rebuilds needed

Test plan

  • Verified Matomo script is NOT included in local dev builds (no matomo.js at root)
  • Verified <script src="/matomo.js"> appears in build output
  • Verified Starlight does not prepend the base path (stays /matomo.js, not /0.2/matomo.js)

Add Matomo tracking to the docs site, matching the portal's setup
(cookies disabled, link tracking enabled, same Matomo Cloud instance).

The tracking script is deployed as a single root-level file (`/matomo.js`)
rather than baked into each versioned build, so the site ID can be
updated without rebuilding existing versions.

> **TODO**: Replace `CHANGEME` in `docs-site/matomo.js` with the actual
> Matomo site ID once IT creates the site for `cli.internetcomputer.org`.
@marc0olo marc0olo marked this pull request as ready for review March 26, 2026 16:35
@marc0olo marc0olo requested a review from a team as a code owner March 26, 2026 16:35
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