Matomo plugin doesn't show statistics

I installed Matomo system on my server, stats is already shown there, but in the panel still see this:

Did all by instructions.

First thought maybe need to wait some time, but on the other hand: there is block with “REAL TIME” stats, so something should be displayed there as long as site has visitors.

@sylvainjule, can you help please?

I just tested the plugin for the first time with my installation and it works out of the box.

Have you made sure that your settings are all correct (id, token and URL)? Since a wrong ID and token show an error message, there’s maybe something wrong with the URL?

I installed Matomo in the same parent directory as website in /matomo/, in config file wrote:

return array(
    'sylvainjule.matomo.url'        => 'https://example.com/matomo',
    'sylvainjule.matomo.id'         => '1',
    'sylvainjule.matomo.token'      => 'MYTOKEN',
);

Path to Matomo is right, project ID is 1 by default and token is also just copied.

What surprises me is that the link to the Matomo dashboard in the upper right corner is missing as well. But I can’t really help you with this, I’m afraid, since I just did a quick test to check if it works as expected.

Have you got any errors in the browser console?

Maybe link will appear together with information.

No, no any errors.

The link is there even if I put a wrong link into the config and get no information displayed. It looks like this:

Are you using the latest version of the plugin?

Is there anything else in your config apart from what you posted above? You are not using duplicate return statements, are you?

1 Like

Yes, it was at the end, tried to put in front and it’s working! Only not sure if now config file has right syntax?

<?php

return array(
    'sylvainjule.matomo.url'        => 'https://example.com/matomo',
    'sylvainjule.matomo.id'         => '1',
    'sylvainjule.matomo.token'      => 'TOKEN',
);

return [
	
	'medienbaecker.autoresize.maxWidth' => 2048,
    'languages' => true,
    'debug' => true,
    'routes' => [
        [
            'pattern' => 'home/(:any)',
            'action'  => function () {
                return go('home');
            }
        ]
    ],
    'bnomei.robots-txt.sitemap' => 'sitemap.xml',
    'omz13.xmlsitemap' => [
        'excludeChildrenWhenTemplateIs' => ['default'],
        'disableImages' => false,
      ],
  'thumbs' => [
    'autoOrient' => false,
        'srcsets' => [
            'default' => [300, 800, 1024],
            'cover'   => [10, 20, 1200]
        ]
    ]
];

You have to put all config settings into a single return array. If PHP sees a return statement, it gives back control to the calling script, ignoring anything that comes after it.

<?php

return [
    'sylvainjule.matomo.url'        => 'https://example.com/matomo',
    'sylvainjule.matomo.id'         => '1',
    'sylvainjule.matomo.token'      => 'TOKEN',
	
    'medienbaecker.autoresize.maxWidth' => 2048,
    'languages' => true,
    'debug' => true,
    'routes' => [
        [
            'pattern' => 'home/(:any)',
            'action'  => function () {
                return go('home');
            }
        ]
    ],
    'bnomei.robots-txt.sitemap' => 'sitemap.xml',
    'omz13.xmlsitemap' => [
        'excludeChildrenWhenTemplateIs' => ['default'],
        'disableImages' => false,
      ],
  'thumbs' => [
    'autoOrient' => false,
        'srcsets' => [
            'default' => [300, 800, 1024],
            'cover'   => [10, 20, 1200]
        ]
    ]
];
3 Likes

I see, all solved, thank you for help.

Matomo is very interesting system, as it shows even more useful info, than Google Analytics, and all that is without a single cookie. And all available in the Panel, so can add value for client and help to sell product.

If anyone would like to use it, I also suggest to switch Geo location setting to this:
geo

as default would give wrong visitors details, like USA instead of Europe.

In Europe (and if you make business in Europe), it won’t make much sense, since you have to anonymise IP addresses to conform to GDPR. If you mask the last 2 bytes like recommended, geo location will be very rough.

Turning that on can be problematic it certain parts of the world, due to privacy concerns (and laws). It’s worth understanding the data that will be collected and how it applies to the laws in your country before enabling them.

" How is Matomo Analytics GDPR compliant?

Matomo can be configured to automatically anonymise data so you don’t process any personal data. This allows you to completely avoid GDPR. If you decide to process personal data, Matomo provides you with various features to easily comply with the GDPR guidelines."

I also have anonymized visitors data, while still see quite accurate geo details.

anon

Yes, but it also says that if you remove the last 2 bytes from the IP, Geo location will not be very exact and they recommend to not use the full IP for geo location for privacy reasons (although you can set it to yes like you did in your settings). I’m not sure what is or is not allowed under GDPR.

Hey. Still having the same problem that Kirby doesnt display any data in the panel. I have set up the most recent version of Matomo and also have the config file as texnixe demonstrated. Any ideas? :confused:

EDIT:
To provide more info: When i use the snippet <?php snippet('matomo'); ?> - it never includes the matomo tracking code. As the inital if statemate wont be fulfilled: <?php if(Matomo::allowed()) : ?>

As a workaround, i just incldued the tracking code manually in my footer.php snippet, yet, I’m wondering if the not-fulfilling if statemate correlates with the issues of not haveing data shown in the backend.

Does your Matoma instance even have any data? If your tracking code doesn’t collect any data, no data can be shown.

Have you set all the required values in your config.php?

return array(
    'sylvainjule.matomo.url'        => false, #required
    'sylvainjule.matomo.id'         => false, #required
    'sylvainjule.matomo.token'      => false, #required for the panel integration
    'sylvainjule.matomo.active'     => true,
    'sylvainjule.matomo.debug'      => false,
    'sylvainjule.matomo.trackUsers' => false,
    'sylvainjule.matomo.blacklist'  => ['127.0.0.1', '::1'],
);

This code checks if the active option is set to true and if the required options (url, id and token) are provided.

Sure,

my config looks just like here: Matomo plugin doesn't show statistics

the token without the &token_auth= prefix… so; i’m just a bit clueless of where the issue is.

Are you testing the plugin on localhost? Then you have to set 'sylvainjule.matomo.debug' => true or pass an empty array to the blacklist option.