This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new 042229bf80a fix(docs): add consistent dev-mode logging for Matomo page
views (#37526)
042229bf80a is described below
commit 042229bf80a79271491e7f2ae30e35d0a0d7d4a9
Author: Evan Rusackas <[email protected]>
AuthorDate: Wed Jan 28 17:54:38 2026 -0800
fix(docs): add consistent dev-mode logging for Matomo page views (#37526)
Co-authored-by: Claude Opus 4.5 <[email protected]>
---
docs/src/theme/Root.js | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/docs/src/theme/Root.js b/docs/src/theme/Root.js
index 210d99e8ed8..10538df6970 100644
--- a/docs/src/theme/Root.js
+++ b/docs/src/theme/Root.js
@@ -74,6 +74,14 @@ export default function Root({ children }) {
window._paq.push(['trackSiteSearch', keyword, category, resultsCount]);
};
+ // Helper to track page views
+ const trackPageView = (url, title) => {
+ if (devMode) {
+ console.log('Matomo trackPageView:', { url, title });
+ }
+ window._paq.push(['trackPageView']);
+ };
+
// Track external link clicks using domain as category (vendor-agnostic)
const handleLinkClick = (event) => {
@@ -221,7 +229,6 @@ export default function Root({ children }) {
trackDocsVersion();
if (devMode) {
- console.log('Tracking page view:', currentPath, currentTitle);
window._paq.push(['setDomains', ['superset.apache.org']]);
window._paq.push([
'setCustomUrl',
@@ -233,7 +240,7 @@ export default function Root({ children }) {
window._paq.push(['setReferrerUrl', window.location.href]);
window._paq.push(['setDocumentTitle', currentTitle]);
- window._paq.push(['trackPageView']);
+ trackPageView(currentPath, currentTitle);
// Check for 404 after page renders
setTimeout(track404, 500);