@robocoder opened this Issue on October 8th 2009 Contributor

UPDATE

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) 
@mattab commented on January 18th 2010 Owner

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.

@mattab commented on February 11th 2010 Owner

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)

@anonymous-piwik-user commented on March 10th 2010

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

@anonymous-piwik-user commented on May 31st 2010

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.

@mattab commented on June 21st 2010 Owner

I'm tempted to mark this as fixed, considering the very nice plugin in: #1436

@robocoder commented on June 21st 2010 Contributor

Agree!

@robocoder commented on July 3rd 2010 Contributor

(In [2420]) fixes #1457 - remove E_EXCEPTION (couldn't find any documentation for this as a predefined PHP constant)

refs #998 - merge upgrade.php and common.php so json_decode() is available to Tracker plugins; sync up with -17 release of upgradephp

This Issue was closed on April 24th 2011
Powered by GitHub Issue Mirror