Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 29, 2026

Plan for Adding Matomo Tracking Code

  • Explore repository structure
  • Identify current tracking implementation (piwik.js exists)
  • Understand Sphinx configuration and theme
  • Add standard Matomo tracking code to layout.html template
  • Validate template syntax
  • Test the implementation in a built documentation
  • Remove duplicate piwik.js reference to avoid double-tracking
  • Verify tracking code is properly included in generated HTML
  • Run code review (passed with no issues)
  • Security scan with CodeQL (no vulnerabilities found)
  • Address feedback: Create matomo.js file similar to piwik.js pattern
  • Address feedback: Keep piwik.js reference (will be removed in future PR)
  • Revert unrelated workflow changes
  • Final verification complete

Summary

Successfully added Matomo analytics tracking to the pyOpenMS documentation using a static JavaScript file approach, while keeping the existing piwik.js tracking.

Created docs/source/_static/matomo.js with standard Matomo tracking code
Updated docs/source/conf.py to include both piwik.js and matomo.js in html_js_files
Reverted .github/workflows/test-pr-sphinx.yml to its original state
Verified both tracking codes are properly included in generated HTML
Tested with Sphinx build - both files correctly loaded and copied to output

Technical Details

  • File Created: docs/source/_static/matomo.js (13 lines)
  • File Modified: docs/source/conf.py (includes both piwik.js and matomo.js)
  • File Reverted: .github/workflows/test-pr-sphinx.yml (kept unchanged as requested)
  • Tracking URL: https://openms-web.containers.piwik.pro/
  • Site ID: 977a289b-8290-4244-920c-847eb3da6b09
  • Pattern: Follows the same static file pattern as the existing piwik.js implementation

Current State

Both piwik.js and matomo.js are now included in the documentation. The piwik.js tracking will be removed in a future PR as planned by the team.

Impact

Both Matomo tracking implementations will be included on all documentation pages when built by Sphinx. This allows for a transition period before removing the old piwik.js tracking.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add matomo tracking code</issue_title>
<issue_description>Please add the code below

<script> var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u="https://openms.matomo.cloud/"; _paq.push(['setTrackerUrl', u+'matomo.php']); _paq.push(['setSiteId', '3']); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.async=true; g.src='https://cdn.matomo.cloud/openms.matomo.cloud/matomo.js'; s.parentNode.insertBefore(g,s); })(); </script>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add Matomo tracking code to the application Add standard Matomo tracking via layout template Jan 29, 2026
Copilot AI requested a review from tjeerdijk January 29, 2026 22:08
@tjeerdijk
Copy link
Contributor

@copilot Can you add a file matomo.js similar as was done for piwik.js

Copy link
Contributor Author

Copilot AI commented Jan 29, 2026

@copilot Can you add a file matomo.js similar as was done for piwik.js

Done! Created docs/source/_static/matomo.js following the same static file pattern as piwik.js. The file is now included via html_js_files in conf.py. (commit 37c4721)

Copilot AI changed the title Add standard Matomo tracking via layout template Add Matomo tracking code via static JavaScript file Jan 29, 2026
@tjeerdijk
Copy link
Contributor

@copilot can you keep the reference to piwik.js in conf.py. we will remove piwik tracking in a future PR

Copy link
Contributor Author

Copilot AI commented Jan 29, 2026

@copilot can you keep the reference to piwik.js in conf.py. we will remove piwik tracking in a future PR

Done! Both piwik.js and matomo.js are now included in html_js_files. (commit c8ba265)

Updated Matomo Analytics tracking code to use new URL and site ID.
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lintly has detected code quality issues in this pull request.

Added a comment explaining the purpose of the script.
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lintly has detected code quality issues in this pull request.

Added installation of PyOpenMS after dependencies.
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lintly has detected code quality issues in this pull request.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lintly has detected code quality issues in this pull request.

@tjeerdijk
Copy link
Contributor

@copilot Can you leave .github/workflows/test-pr-sphinx.yml unchanged and run checks again?

Copy link
Contributor Author

Copilot AI commented Jan 30, 2026

@copilot Can you leave .github/workflows/test-pr-sphinx.yml unchanged and run checks again?

Done! Reverted .github/workflows/test-pr-sphinx.yml to its original state. (commit dd044ca)

Copy link
Contributor

@tjeerdijk tjeerdijk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thx copilot

@tjeerdijk tjeerdijk marked this pull request as ready for review January 30, 2026 17:33
@tjeerdijk tjeerdijk merged commit f7cf34f into master Jan 30, 2026
3 checks passed
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.

Add matomo tracking code

3 participants