halfer / piwik-database-configuration

A Piwik plugin to set the database connection using environment variables
3 stars 2 forks source link

It works for the backend login, but not for tracking. #2

Open pier56 opened 6 years ago

pier56 commented 6 years ago

First of all, thank you for this awesome feature ! :+1: My problem is the following : 1) If I remove information from the config.ini.php file as explained in the readme (eg. host = ""...) Matomo doesn't seems to like it (error : "Matomo doesn't seems to be installed" when requesting to asynchronously track) 2) If I put random strings in this config file (eg. host = "XYZ"...) I can login in the Matomo admin, but tracking does not work. (No more error "Matomo doesn't seems to be installed", but I don't get tracked in frontend).

Thank you in advance for your answer. Cheers :)

halfer commented 6 years ago

Hm, interesting. I should say I've not kept track of Piwik developments since it was renamed.

Reading point (1), I was going to suggest the change you outline in point (2), which is putting in dummy credentials to satisfy the need for them, in the hope that the plugin would override them.

What do you get in your PHP/Apache logs when you make a tracking request? I wonder if it is trying to connect to the database but is failing? If so, that might mean the plugin is not being recognised at all.

It might be worth examining your logs to see if there are any warnings/errors from the database.

agtb commented 6 years ago

I used similar code to this plugin and it worked for me in the latest version of Matomo, 3.5.1 .

Couple of suggestions:

If that's all fine and you can log in to the admin, then I think you have an issue with the tracking code. There is some troubleshooting on this Matomo FAQ.

HTH

weichendigital commented 5 years ago

I was facing similar issue earlier on, but I managed to find a solution for it. If you want to use this method it for Piwik's Tracker, add 'Tracker.getDatabaseConfig' => 'getDatabaseConfig' in registerEvents in DatabaseConfiguration.php.