Skip to content

feat(docs): dual-track page views to Aztec Labs Matomo with consent gating#24444

Open
critesjosh wants to merge 1 commit into
nextfrom
docs/matomo-azteclabs-tracking
Open

feat(docs): dual-track page views to Aztec Labs Matomo with consent gating#24444
critesjosh wants to merge 1 commit into
nextfrom
docs/matomo-azteclabs-tracking

Conversation

@critesjosh

Copy link
Copy Markdown
Contributor

What

Adds the Aztec Labs Matomo instance (azteclabs.matomo.cloud, site ID 23) to the docs site as a second analytics tracker, and gates all tracking behind the existing cookie-consent banner.

Change is confined to docs/src/components/Matomo/matomo.jsx.

Dual-tracking

  • Registers the azteclabs instance via Matomo's addTracker on the shared _paq queue, so every page view is sent to both the existing noirlang.matomo.cloud (site 6) tracker and the new azteclabs (site 23) one.
  • Adds setDomains + enableCrossDomainLinking + enableLinkTracking for cross-domain tracking across the aztec.network / docs.aztec.network / noir-lang.org / play.aztec-labs.com / testnet.aztec.network properties.

Real consent-gating

  • Adds requireConsent so no tracking request fires to either instance until the user clicks "I accept cookies". This also closes a pre-existing gap where the noirlang tracker beaconed on page load regardless of consent.
  • The choice is persisted in Matomo's own cookie (via the existing rememberConsentGiven / forgetConsentGiven handlers), so returning visitors who accepted are tracked automatically without re-prompting.

Testing

Verified end-to-end in a browser against a local Docusaurus dev server:

State Result
Fresh visitor, no consent Matomo loaded, both trackers registered (consentRequired: true), banner shown, 0 beacons to either instance
Click "I accept cookies" Held page view flushed to both — noirlang (idsite=6) + azteclabs (idsite=23), each with consent=1
Navigate to another page Banner gone, hasRememberedConsent: true, page view auto-tracked to both, no re-prompt
Refuse path forgetConsentGiven leaves consent unremembered, so nothing tracks

…ating

Add the azteclabs.matomo.cloud instance (site 23) as a second tracker on
the shared _paq queue via addTracker, so docs page views are sent to both
the existing noirlang instance and the Aztec Labs one, with cross-domain
linking across the aztec.network / noir-lang.org properties.

Also add requireConsent so no tracking request fires to either instance
until the user opts in via the cookie banner. Matomo persists the choice
in its own cookie, so returning visitors who accepted are tracked
automatically without re-prompting.
@critesjosh critesjosh requested a review from alejoamiras July 1, 2026 19:54
@critesjosh critesjosh enabled auto-merge July 1, 2026 19:55
@critesjosh critesjosh disabled auto-merge July 1, 2026 20:02
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.

2 participants