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.66k stars 2.62k forks source link

When Provider report shows "unknown" only, add message in report footer explaining why #4424

Closed anonymous-matomo-user closed 9 years ago

anonymous-matomo-user commented 10 years ago

After the update to 2.0.1 and 2.0.2 i can't see any "Provider", i see only Provider: Unknown ...

Is that a bug?

mattab commented 10 years ago

Provider works on the demo... Sorry I'm not sure what could create the problem for you?

anonymous-matomo-user commented 10 years ago

Okay yes, i see on the demo works but on my server and on three other server "Provider" is not working (after the update) .. In the german piwik forum is an other people that have the same problem (http://forum.piwik.org/read.php?5,108827)

The background:

I use Piwik with the Wordpress plugin "WP-Piwik" Typo3 > Piwik - web analytics, new API (piwik)2.0.0 and xTCommerce > Piwik 1.0.3 (df_piwik)

The function "gethostbyaddr" works without any problems on my servers ...

mattab commented 10 years ago

Do you see any error in error log?

anonymous-matomo-user commented 10 years ago

Bug exists in latest stable version (2.0.3). Situation: Anonymization (1 bit), geolocation via PECL brings correct country/city as far as i can tell.

[http://forum.piwik.org/read.php?5,85684](German piwik forum, concerning 1.7.0) still works to come around with this.

Following works for me: plugins/Provider/Provider.php - line 126:

//            return;
        $ip = substr($ip, 0, -2) . '.1';

Hope this bug gets fixed soon.

mattab commented 10 years ago

Using Piwik 2.0.3 in the anonymization settings you can choose to anonymise IP address after the geo location is done. Can you try to change this setting in Privacy section?

Maybe we could also mention this in the "Report footer help" that we could display when all providers are set to unknown.

anonymous-matomo-user commented 10 years ago

I have to confess it's working now after setting "useAnonymizedIpForVisitEnrichment" (third option at anonymization settings) to "no". I can't reproduce whether this setting was there before or not.

So as far as i'm concerned the ticket may be closed.

Here in germany there's a lot of discussion about Privacy. To be in compliance with the law i enabled anonymization, masked the last bit of the ip and left the third option as it stated to be better privacy setting.

Maybe it would be a good idea to just clarify the description of this option. Does it save full ip or is the full ip just used in time to get the hostname/provider-informations and replaced by the masked ip immediately (that's how i understand it now).

Example for the clarification:

"Plugins such as Geo Location via IP and Provider improve visitor's metadata. By default these plugins use the anonymized IP addresses but may result in 'unknown' Provider data. If you select 'No', then the non-anonymized full IP address will be used instead, resulting in less privacy but better data accuracy. The full IP address will be masked immediately according to the settings above to be stored."

As stated before there's a lot of discussion about legal usage of the full ip for geo locating. It looks like being forbidden at least in germany to use the full ip at all for generating metadata. To be totally compliant with the law it may be necessary to set this option to yes.

Maybe it would be possible to create a generic IP address and use it for provider as this is the only data getting "unknown" if the option discussed here is set to yes.

Add one more option "useGenericAnonymizedIpForVisitEnrichment" (Description-> "If set to yes the anonymized IP addresses last bits will be set to 1 to aquire a Provider. Depending on the used address ranges of the provider this may give wrong Provider data.")

plugins/Provider/Provider.php line 121

        // In case the IP was anonymized, we should not continue since the DNS reverse lookup will fail and this will slow down tracking
if (substr($ip, -2, 2) == '.0') {
    if ($useGenericAnonymizedIpForVisitEnrichment) {
        $ip = substr($ip, 0, -2) . '.1';
    } else {
        Common::printDebug("IP Was anonymized so we skip the Provider DNS reverse lookup...");
        return;
    }

I don't program so there may be errors in the code above. But i guess you get what i mean. Also feel free to correct my english ;)

mattab commented 9 years ago

it was improved in #6101 and no need for more work