mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix(docs): add consistent dev-mode logging for Matomo page views (#37526)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user