rusackas opened a new pull request, #37526:
URL: https://github.com/apache/superset/pull/37526

   ## Summary
   
   Adds consistent dev-mode console logging for Matomo page view tracking to 
match the existing `trackEvent` logging pattern.
   
   **The Problem:**
   When running the docs site locally, developers see console logs like:
   ```
   Matomo trackEvent: {category: 'User Preference', action: 'Color Mode', name: 
'light'}
   Matomo trackEvent: {category: 'User Preference', action: 'Docs Version', 
name: 'latest'}
   ```
   
   But there was no equivalent log for `trackPageView`, making it seem like 
only events were being tracked when page views were actually being tracked 
correctly.
   
   **The Fix:**
   Added a `trackPageView` helper function that mirrors the `trackEvent` 
pattern:
   ```javascript
   const trackPageView = (url, title) => {
     if (devMode) {
       console.log('Matomo trackPageView:', { url, title });
     }
     window._paq.push(['trackPageView']);
   };
   ```
   
   Now developers will see:
   ```
   Matomo trackPageView: { url: '/docs/databases/bigquery', title: 'BigQuery | 
Superset' }
   ```
   
   This provides clarity that page views ARE being tracked for all pages, 
including dynamically generated ones like database docs.
   
   ## Test plan
   
   - [x] Run docs site locally (`yarn start` in `/docs`)
   - [x] Navigate between pages
   - [x] Verify console shows `Matomo trackPageView:` logs alongside event logs
   - [x] No changes to production behavior (logging only happens in dev mode)
   
   🤖 Generated with [Claude Code](https://claude.ai/code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to