Add 'visit_total_actions' in visitorinfo for hook Tracker.knownVisitorInformation


(cn_Dark) #1

Hello,

I am writing ECommerce plugin. And like google analytics, I want to show “page views before purchase” and “time spent before purchase”.
This is array visitorInfo by hook Tracker.knownVisitorInformation.

Array
(
    [visitor_idcookie] => 71d3bf5eaf246a13b7e1f1344789553e
    [visit_last_action_time] => 1250668803
    [visit_first_action_time] => 1250667930
    [idvisit] => 55
    [visit_exit_idaction] => 3
    [idsite] => 1
    [visit_server_date] => 2009-08-19
    [time_spent_ref_action] => 194
)

We can see that it is easy to know “time spent before purchase”.
But I can’t know “page views before purchase” if I don’t modify “core/tracker/visit.php” .
Can piwik add this feature?


(vipsoft) #2

Total page views per visitor is not currently aggregated. Without a database schema change, the additional query would be a significant performance hit on the Tracker. Please create a feature request ticket in Trac.


(cn_Dark) #3

In database, the table piwik_log_visit, what is “visit_total_actions” mean? Is it means that this visit have “visit_total_actions” pageview?


(vipsoft) #4

Unless I’m mistaken, that’s not what you want, but we can add it.


(cn_Dark) #5

It seems that ‘total actions’ means the amount of visits for this idvisit according to my test. Maybe I have mistake in understanding pageview.
How can add this??


(vipsoft) #6

It’s still non-trivial to add. Currently, the Tracker doesn’t cache it in the cookie or SELECT it after it’s incremented.


(Matthieu Aubry) #7

cndark, in this case you might have to hook and select the data you need from the database, as vipsoft, we don’t select any data from piwik_log_visit, so doing it in core would add overhead.