matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.71k stars 2.62k forks source link

[Bug] Disabling Goals Plugin cases error when opening Visitor Profile popup #22000

Open sschueller opened 6 months ago

sschueller commented 6 months ago

What happened?

When you disable the goals plugin an error will occur when opening a "Visitor Profile".

Error: The plugin Goals is not enabled. You can activate the plugin on Settings > Plugins page in Matomo.

What should happen?

Visitor Profile should open without an error or if there is no possibility to show this the button to open the profile should not be visible.

How can this be reproduced?

  1. Copy all 3 files: https://github.com/matomo-org/docker/tree/master/.examples/nginx
  2. Set DB password in docker-compose.yml and db.env to be the same
  3. Start the stack with docker-compose up
  4. Follow installation at http://localhost:8080
  5. Enable dev mode docker exec -it matomo_test-app-1 vi config/config.ini.php add:
    [Development]
    enabled = 1
  6. Add fake page to generate traffic. docker exec -it matomo_test-app-1 vi test.html
    <html>
    <head></head>
    <body>
    test
    <!-- Matomo -->
    <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="//localhost:8080/";
    _paq.push(['setTrackerUrl', u+'matomo.php']);
    _paq.push(['setSiteId', '1']);
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
    g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
    })();
    </script>
    <!-- End Matomo Code -->
    </body>
    </html>
  7. Visit this page a few times to generate traffic: http://localhost:8080/test.html
  8. Disable goals plugin
  9. Click on any "View visitor Profile"

Matomo version

5.0.2

PHP version

8.2.15

Server operating system

matomo:fpm-alpine docker

What browsers are you seeing the problem on?

Firefox

Computer operating system

MacOS

Relevant log output

ERROR Live[2024-03-07 08:00:06 UTC] [3ca3f] Uncaught exception in API: /var/www/html/core/Plugin/Manager.php(303): The plugin Goals is not enabled. You can activate the plugin on Settings > Plugins page in Matomo. [Query: ?date=yesterday&module=Live&action=getVisitorProfilePopup&visitorId=518fc5298fe847d6&idSite=1&period=day, CLI mode: 0]
ERROR Piwik\ExceptionHandler[2024-03-07 08:00:06 UTC] [3ca3f] Uncaught exception: /var/www/html/core/Plugin/Manager.php(303): The plugin Goals is not enabled. You can activate the plugin on Settings > Plugins page in Matomo. [Query: ?date=yesterday&module=Live&action=getVisitorProfilePopup&visitorId=518fc5298fe847d6&idSite=1&period=day, CLI mode: 0]

Validations

sschueller commented 6 months ago

Similar Issue: https://github.com/matomo-org/matomo/issues/12028

mneudert commented 6 months ago

Hi @sschueller, can confirm deactivating the Goals plugins breaks the visitor log on both 4.x and 5.x.

Will pass this on to the product team for prioritization.


Should be checked if there are any side effects, e.g. to ecommerce tracking, if we simply test for Goal plugin activation status in the relevant places (#1, #2, maybe more).