See ticket #1436 - which allows to track additional information about community users. It generates reports about:
* usertype (user/guest) including evolution
* users age-group
* evolution of average age
* gender (male, female, unknown) including evolution
* user activity (list of the most active user)
vipsoft, this has indeed be one of the most asked questions. If you are keen to start on this, I can help you with dev.
Also, explain how to use the Updates in the plugin (ie. create a Updates/X.php where X is the version of the plugin upgraded to, that can contain php code and sql queries)
It would be very helpful if you could just let us know which hook to use and what array the custom data is stored in. Thanks
You can use "Tracker.Action.record". Here is some code from a plugin we made recently:
function getListHooksRegistered()
{
return array(
'Tracker.Action.record' => 'newAction',
);
}
function newAction($action) {
try {
// This fills the $visitor_id variable with Piwik's visitor ID. There are also other variables which you can get access to, just print_r($action);
$visitor_id = $action->_notificationInfo['idVisit'];
$data = $action->_notificationObject->getRequest();
$data = json_decode(stripslashes($data['data']));
} catch (Exception $e) {
return false;
}
// Can now access custom variables through $data->*, like so:
$my_custom_variable = $data->my_var;
}
Hope this helps someone.
I'm tempted to mark this as fixed, considering the very nice plugin in: #1436