I’ve been talking about it on this forum since a fair amount of time now.
But most of the time, i was saying that i dont have the time nor the knowledge required to do that plugin myself.
But i each time that i look into this, that i go on dev.piwik.org to look at the plugin building explanation and then i go into my Piwik database, i see that showing visitor path wouldn’t be too complicated as all data is already there in the tables log_visit, log_action and log_link_visit_action for the plugin to collect and display in a human readable table.
But today, after some fair amount of time thinking about it since previous look inside the database a few months ago, i’m thinking that a Visitor path plugin could be a bad idea somehow.
And why is that ?
Simply because that plugin doesn’t seems to be able to get it’s data from the archives tables.
Or is it just that i dont yet understand the format of thoses tables ?
Neverless, a Visitor path plugin could still be easilly done (could take me some months but still).
Another problem that could arise is that someday Piwik users will be able to get rid of the content of the precited tables to purge older data that isn’t needed anymore. One could also decide to purge it all.
That could still permit Piwik to show statistics since it would read it from the archives.
But not the Visitor path plugin, unless i could manage to find the needed data in the archives.
I wonder how the Live Plugin does it. I might take a look at it’s code if i ever feel like it someday.
In the mean time, my understanding of how the Visitor path plugin should work is as follow :
- First, it’s a report page, not a widget.
- When it begin fetching it’s data, it get the timeframe from Piwik.
- Then it ask the DB a how many visits there was for that period. It might be important to know the number of pages of ten visitors the table will have to show (or maybe Piwik dev already made code to do this easier).
- The plugin then get the 10 last visits data for that period. Not all data. Specific columns in the table log_visit (or in the archive?). Date and hour of visit, referer or keywords, browser, screen res, etc.
- Show thoses 10 visits informations in a nice table similar to the Visitor log table but that fit on the screen. It also put a “link” on each of them that when it’s clicked it :
- query the table log_link_visit_action with the number of the visit (idvisit) to get the list of actions
- for each of them, it query the log_action table to get their name or URL, not sure wich is better.
- Then it display the list of actions in a nice format in place of the link.
It could also query all the actions right away but i’m afraid it would put load on the DB or something. If this is true, it might be needed to limit the number of actions it load to 10 or 20 and display a “more” link.
The hardest part for me would be the “ajax loading” of data. I’m still learning… I could say that when i see some PHP code, i understand most of the time what it does. But i never really made anything in PHP yet. I’ve been studying it a lot but PHP get a new version before i can do anything and i restart my learning.
But i think i’m ready to try (slowly) making that visitor path plugin. I always have WAMP working on my computer. I’ll began by installing a local copy of Piwik.
Why is that ? Maybe because i currently dont have any usefull project in my life and i’m getting depressed… lol.