[Piwik-hackers] Writing to Visits table

mikael letang mikael.letang at gmail.com
Tue Jul 22 23:22:18 CEST 2008


Hi Chris

I received your plugin code - but won t probably be able to look at it
before this week-end

Firebug is a Firefox plugin you can find here: http://getfirebug.com/

Once installed, you ll see a small icon in the bottom right side of your
browser. When you browse the website your are monitoring (in which you put
the js code), if you click on this icon and then on the "Net" tab, you see
all the requests (including the call made by the piwik js) and their
responses. (firebug gives loads of other functionalities by the way)
So if there are errors returned by the piwik call you ll be able to see it.

Besides other things I could think of:
- you must have enabled the plugin in the Piwik adminitration console (so
that the install function get run, and the column get installed)
- to ease your test, you can specify the min duration between two visits.
(if you visit twice the same page from the same machine/ browser within this
minimum duration, it won t actually log the second  visit)
By default this value is set to 30 min, which is not very convenient for
testing.
You need to change VISIT_STANDARD_LENGTH to a small value (like 1) in
modules/LogStats.php

Hope this help, let me know if you have further questions

Mikael

2008/7/23 Chris Songer <csonger at gmail.com>:

>  I have started with a fresh install and am going to attempt to install
> GeoIP. However the Plugin that I have created with all of the following
> steps still doesn't seem to work. Could you elaborate on the firebug
> response so that I can trace my error and report.
>
>
> On 7/21/08 4:27 PM, "mikael letang" <mikael.letang at gmail.com> wrote:
>
> Hi Chris
>
> - Regarding GeoIP: You mean to say that once installed, it prevent data to
> be loggued? Did you install the last version?
>
> - For your plugin: first, you can use the Provider plugin as a template. It
> is possible that the tutorial is not exactly up to date with the last
> architecture of Piwik.
> check that you did the following steps:
> -> in YourPlugin.php, in the getInformation() function you must specify
> that your plugin is loging stats in the $info array, which must contain
> 'LogStatsPlugin' => true,
>
> -> in the install() function, you must alter the table log_visit
>
> -> You can check with the firefox firebug plugin the response of the
> request done by your monitored website - if you see errors returned by that
> request, it may help.
>
> If you need more info on any of these steps just ask.
>
> You can also send me your plugin and I may be able to check it out
>
> Cheers,
>
> Mikael
>
> 2008/7/22 Chris Songer <csonger at gmail.com>:
>
> 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 <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.
>
> _______________________________________________
> Piwik-hackers mailing list
> Piwik-hackers at piwik.org
> http://lists.piwik.org/cgi-bin/mailman/listinfo/piwik-hackers
>
>
>
> ------------------------------
> _______________________________________________
> Piwik-hackers mailing list
> Piwik-hackers at piwik.org
> http://lists.piwik.org/cgi-bin/mailman/listinfo/piwik-hackers
>
>
> _______________________________________________
> Piwik-hackers mailing list
> Piwik-hackers at piwik.org
> http://lists.piwik.org/cgi-bin/mailman/listinfo/piwik-hackers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.piwik.org/pipermail/piwik-hackers/attachments/20080723/61c79db9/attachment-0001.htm 


More information about the Piwik-hackers mailing list