Created on 4 December 2021, over 3 years ago
Updated 16 January 2023, over 2 years ago

After looking at the current codebase and the remaining issues, I think the module architecture should be reworked to be extendable, more alterable and more OOP.

I propose to rework it around 2 plugin types.

Tracking activation control plugins (regarding comment 11, let's use the core condition plugin system and add the ones not present already):
- Pages
- Roles
- Users
- (See comment 9, should be in a dedicated project)

Tracking activation control plugins could maybe be reused for a Matomo Tag Manager module #2978703-12: Support Matomo Tag Manager β†’ .

Tracking behavior plugins (new):
- Domain
- Page titles hierarchy
- Links and downloads: and also take #2904105: Add option to customize ignore classes for link tracking β†’ into account
- Colorbox
- Messages
- Search
- Search API: #3082148: Cannot track search requests if not using default search module β†’
- Privacy
- JS before
- JS after
- Custom variables: also rework custom variables to be able to add as many variables as you want and not 5 max.
- 403/404: #3245705: Make tracking of 404/403 pages optional β†’
- User ID

Each plugin can declare:
- dependency on modules to be seen in the admin UI and active.
- permissions for admin UI access

Make this rework with the following issues in mind to see if possible to do it in the same time:
- #2948060: Implement twig template for tracking code customization β†’ : plugins approach would cover this one too I think
- #3216010: Matomo js script insertion is too opinionated β†’ : I wonder if this is not duplicating #2948060: Implement twig template for tracking code customization β†’
- #2595855: Make the tracking files (js, php) configurable β†’
- #3130324: Use "js/" instead of "matomo.js" β†’
- #3210239: The URL check on admin form validation is too restrictive β†’
- #3160567: Encourage users to choose a HTTPS only strategy β†’

TODO:
- implement plugins system
- convert existing code into plugins
- need to split matomo.admin.js for each plugins
- provide a mecanism to control plugins execution order? Like Search API processors
- rewrite matomo.js to have the colorbox part isolated and also maybe implement Drupal JS behaviors
- also maybe fire an event to alter Matomo code before rendering?
- create a new config entity type and convert matomo settings into this config entity so wa can support #3311301: Is it possible to report to multiple IDs? β†’
- update and add tests
- once everything will be ok, make upgrade path. Force to update on Matomo 8.x-1.x first, so we can drop Piwik update support?

🌱 Plan
Status

Active

Version

2.0

Component

Miscellaneous

Created by

πŸ‡«πŸ‡·France Grimreaper France πŸ‡«πŸ‡·

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024