Repository navigation
Document Hybrid Tracking (consent-aware analytics) - #990
Open
nathangavin wants to merge 2 commits into
Open
nathangavin wants to merge 2 commits into
nathangavin wants to merge 2 commits into
Conversation
Add a guide for measuring visitors who give consent without the restrictions a compliance policy applies, and reference the new tracker method, HTTP API parameter and log_visit column from the existing tracking, JavaScript and database schema pages. Co-Authored-By: Claude <noreply@anthropic.com>
tzi
marked this pull request as ready for review
November 23, 2026 21:51
tzi
reviewed
Nov 23, 2026
tzi
reviewed
Nov 23, 2026
tzi
reviewed
Nov 23, 2026
tzi
reviewed
Nov 23, 2026
tzi
reviewed
Nov 23, 2026
tzi
reviewed
Nov 23, 2026
tzi
reviewed
Nov 23, 2026
tzi
reviewed
Nov 23, 2026
tzi
reviewed
Nov 23, 2026
tzi
left a comment
Contributor
There was a problem hiding this comment.
Hybrid Tracking will be completed by several follow-up PRs: the IP address (matomo-org/matomo#25759), the device model and versions (#25754), the screen resolution (#25768), the order ID (#25767), the PII URL parameters (#25777) and the third-party cookie (#25782).
Each of them will change this guide: the data listed in the introduction and in the "released in stages" note, "Known limitations", and for some "When consent arrives part way through a visit" (#25777 changes the visit split) and "For plugin developers" (#25759 changes Tracker.setVisitorIp). Could each follow-up PR come with its own update to this guide, so the guide always matches what is released?
tzi
reviewed
Nov 23, 2026
tzi
reviewed
Nov 23, 2026
tzi
reviewed
Nov 23, 2026
tzi
reviewed
Nov 23, 2026
tzi
reviewed
Nov 23, 2026
Thirteen corrections from review, taken as written: - the setting now lives on Privacy > Compliance and applies per website or to all websites, so the setup steps and the prerequisites were out of date - requireConsentForRestrictedData() changes what the tracker does; it is not what makes the server honour consent, so a page using requireConsent() is measured as consenting too - getConfiguredValue() only answers for the PrivacyManager settings on its allowlist and throws for anything else, which a plugin cannot extend - setConsentGiven() and rememberConsentGiven() turn cookies back on after disableCookies(), which the cookies paragraph had backwards - consent is recorded on the visit, so later requests of the same visit count without repeating the parameter - forgetConsentGiven() also clears mtm_consent, and takes cookies away only where no separate cookie consent was given - where to find consented visits in the Visits Log and the GDPR tools - the remembered-consent cookie expires after 30 years rather than never - turning the setting off changes later requests only, not stored data - a withdrawal in another window stops that window only where it had read the consent from the cookie
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.
Description
Documents Hybrid Tracking (consent-aware analytics), added by matomo-org/matomo#25719. A website measuring under a compliance exemption can measure every visitor from the first page view, and also collect campaign values, full referrers and User ID for visitors who give consent.
tracking-consent-hybrid.md, listed under Tracking after Tracking & Cookie Consent:requireConsentForRestrictedData(), a full tracking snippet and the Tag Manager optionsetConsentGiven()/rememberConsentGiven()and themtm_measurement_consentcookie, and the signals that don't count as consent (cookie consent,mtm_consent)forgetConsentGiven()) compared with opt-out (optUserOut(),forgetUserOptOut())consentHTTP API parameterlog_visit.consentand theconsentStatesegmenttracking-consent.md: Hybrid Tracking added as a third consent option, linking to the guide.tracking-javascript.md: addsrequireConsentForRestrictedData()andisRestrictedDataConsentRequired(), and howsetConsentGiven(),rememberConsentGiven()andforgetConsentGiven()behave when it is used.tracking-api.md: theconsentparameter.database-schema.md: thelog_visit.consentcolumn.Opened as a draft. Merge after matomo-org/matomo#25719. Before merging, check these against the code as it is released:
consent=0wording, which Record a visitor's refusal of consent on the visit matomo#25755 changes to an explicit refusalChecklist
Review
🤖 Generated with Claude Code