@mfb opened this issue on July 22nd 2008

For legal reasons some websites cannot log IP addresses of website visitors. This may be due to privacy restrictions or other legal issues.

Is it possible to disable IP address logging in piwik? If not this would be a great feature to add. Anonymized IP address be recorded in the database as "0".

@mattab commented on July 28th 2008

Piwik needs to store IP in order to maximise chance of detecting unique visitors. Every web analytics logs this data anyway.

Piwik will NOT display these IPs in the user interface.

@mfb commented on July 28th 2008

Here's a plugin to anonymize IP addresses which seems to work just fine in my testing.

<?php
/**
 * Piwik - Open source web analytics
 * 
 * @link http://piwik.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html Gpl v3 or later
 * @version $Id$
 * 
 * @package Piwik_IPAnon
 */

/**
 * 
 * @package Piwik_IPAnon
 */
class Piwik_IPAnon extends Piwik_Plugin
{
    public function getInformation()
    {
        $info = array(
            'name' => 'IPAnon',
            'description' => 'IP anonymizer',
            'author' => 'Indybay',
            'homepage' => 'http://www.indybay.org/',
            'version' => '0.1',
            'LogStatsPlugin' => true, // this plugin must be loaded during the stats logging
        );

        return $info;
    }

    function getListHooksRegistered()
    {
        $hooks = array(
            'LogStats.newVisitorInformation' => 'logIPAnonymize',
        );
        return $hooks;
    }


    /**
     * IP Anonymizer
     */
    public function logIPAnonymize($notification)
    {
        $visitorInfo =& $notification->getNotificationObject();        
        $visitorInfo['location_ip'] = 0;
    }

}
@mfb commented on July 28th 2008

I'm new to Piwik but as far as I can tell, visitors without a cookie are identified via config_md5config (aka configurationHash), and whether or not you log it the IP address will still be a part of config_md5config, allowing visitors to be differentiated.

I definitely agree that there's a concern of the IP address being looked up; my method was to also anonymize some other parameters in the configurationHash. This makes the data set for the hash much larger, granted I'm not sure it's "good enough" for an entity determined to "crack" an IP.

@robocoder commented on July 9th 2009

To reiterate comment:1, we aren't accepting this into Piwik core.

See #692 instead.

@mattab commented on July 9th 2009

please create a new ticket, package the plugin in a .zip that is ready for install, add a description like other tickets, and we will put it in the Third Party Plugin category. thanks! http://dev.piwik.org/trac/query?status=new&status=assigned&status=reopened&group=milestone&milestone=Third+Party+Piwik+Plugins&order=priority

This issue was closed on August 4th 2009
Powered by GitHub Issue Mirror