Tracking the IPv6 reach of your Website with Piwik

IPv6 is slowly adapted by ISPs around the globe. If your website is accessible with both IPv4 and IPv6 it might be interesting to see how users are accessing your website and how it changes overs time.

IPv6Usage

The IPv6Usage plugin for Piwik allows you to track how many of your users are using IPv6. To do that it adds a single column to the log_visits table of your Piwik installation. By using the Piwik plugin architecture the plugin can be installed just by uploading a single folder.

Requirements

Your Piwik installation needs to be accessible over IPv6. There are several hosters that provide IPv6 with their web hosting plans.

Make sure your domain (and the one of your Piwik installation, if they are seperate) has an AAAA-Record set. You can check this on the console:

$ host -t AAAA geekmonkey.org
geekmonkey.org has IPv6 address 2a03:2900:2:1::e3  
$ nslookup
> set type=AAAA
> geekmonkey.org
Server:        127.0.0.1  
Address:    127.0.0.1#53

Non-authoritative answer:  
geekmonkey.org    has AAAA address 2a03:2900:2:1::e3  

If you are not sure whether your IPv6 setup works you can check your website's connectivity using this webservice.

Installation

You have two options to install the plugin.

Manual Installation

Download the latest zip from the Github page and unzip the package into the plugins/ directory of your Piwik installation. You need to rename the created directory to IPv6Usage.

Now all you need to do is head to your Piwik installation and activate the plugin under Settings -> Plugins.

Git

If you have shell access to your server and Git is installed, cd into the plugins/ directory of your Piwik installation and clone the IPv6Usage repository from Github.

cd /path/to/piwik/plugins/  
git clone https://github.com/halfdan/IPv6Usage.git  

Now all you need to do is head to your Piwik installation and activate the plugin under Settings -> Plugins.

Reports

The plugin provides two widgets to compare IPv4 to IPv6 usage. You can find both widgets under Visitors when adding Widgets through the dashboard.

Visits by Protocol

The pie chart shows you the number of visits by protocol version in proportion to the total number of visits.

IPv6 Evolution

The "IP Protocol Usage over Time" Widget shows you the evolution of visits by protocol over time.

You can also view the statistics the plugin provides using the Piwik Mobile App:

IPv6 Report on Android

Accuracy

The way IPv6 works today makes it hard to track the exact numbers of people that could potentially access your website with IPv6. Most users will be in a dual-stack environment where they have IPv4 and IPv6 connectivity. Depending on the browser and OS settings a dual-stack user might still use IPv4 even if IPv6 is available on your website. The plugin cannot check whether IPv6 is potentially available, it does only track those users that are using IPv6 in the tracking request to your Piwik installation.

There are ways users can force IPv6 over IPv4, but in most cases users will just not care how a website is accessed.