[Piwik-hackers] Writing to Visits table

Chris Songer csonger at gmail.com
Mon Jul 21 15:08:13 CEST 2008


I have followed the tutorials on Advavnced using the GeoIP. The GeoIP for
one stops all data logging to piwik when activated. I have no idea. But I am
wanting to write a custom field that I pass in on an optional variable. Here
is the code I am using in my plugin.

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

function logMonkeyInfo($notification){                $visitorInfo =&
$notification->getNotificationObject();        $custom =
Piwik_Common::getRequestVar('vars',array(),'array');
$visitorInfo['monkey'] = $custom['monkey'];    }
####################.php

<!-- Piwik --> <a href="http://piwik.org" title="Open source analytics"
onclick="window.open(this.href);return(false);">    <script
type="text/javascript">        <!--        piwik_action_name = '';
piwik_idsite = 1;        piwik_url =
'http://127.0.0.1:8888/piwik/piwik.php';
//$.getJSON("server.php",function(json){document.data =
json['REMOTE_ADDR'];});        piwik_vars = { 'monkey':'<?=
$_SERVER['REMOTE_ADDR'] ?>'};         piwik_log(piwik_action_name,
piwik_idsite, piwik_url, piwik_vars);        //-->    </script>    <object>
<noscript>            <p>Open source analytics <img
src="http://127.0.0.1:8888/piwik/piwik.php" style="border:0"
alt="piwik"/></p>        </noscript>    </object> </a> <!-- /Piwik -->
####################.js

Any help would be awesome. It is just not writing the data into the table.
Even if I replace the `$custom['monkey']` with a simple string `bananas`,
still nothing.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.piwik.org/pipermail/piwik-hackers/attachments/20080721/ab028386/attachment.htm 


More information about the Piwik-hackers mailing list