Possible new plugin : Visitor path

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 :

  1. First, it’s a report page, not a widget.
  2. When it begin fetching it’s data, it get the timeframe from Piwik.
  3. 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).
  4. 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.
  5. 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 :
  6. query the table log_link_visit_action with the number of the visit (idvisit) to get the list of actions
  7. for each of them, it query the log_action table to get their name or URL, not sure wich is better.
  8. 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.

You can easily write a VisitorPath plugin that acts as a tracker plugin also. As this it would be able to add data to the log tables and archive it later on (have a look at the hooks for ArchiveProcessing_day.compute, ArchiveProcessing_period.compute, e.g. in the Goals.php of the Goals plugin). If you need any help writing that plugin just post a message here. You can also create a trac ticket for your plugin to show the status and explain what you need in core to realise it (if you need anything).

Please don’t get depressed, there are too many cool things to do (for example, working on Piwik) :slight_smile:

I must warn that this plugin could be complicated to start with and I would recommend something simpler, like a smaller bug or smaller feature.

Yeah, might not be easy.
That’s why i’ll take it slowly.
I didn’t even installed a local copy yet.
And for every thing that i might have trouble with, i will do search on the net, look into existing code and read documentations.
And it seems the Piwik version between the current and the 1.0 release plan to make it easier and work on docs.
This seems almost perfect timing.

But, you wanna know what ?
A few day after posting this topic, i also began a new VB .Net project (using SharpDevelop); a small CSS editor with support for CSS3 PIE (that thing add CSS3 support to IE, still a beta but it seems good).
And this project too will be “too complicated” because i don’t yet understand how to do a “file parser” when thoses files could be written in any possible way and even with errors.

I can easilly get in depress state because i have no real work and almost no life. But this is also because i worked on french wikis on Wikia that never got more than a few users; it feel like i wasted my time, or so.

Having some programming projects make me feel better.

LOL !

You guys really did it ?

I have a friend that is using Piwik since i showed him (and that he doesn’t like the new UI) and his installation already has acces to 0.8 in wich i discovered that the user log is now very similar to that plugin idea.

If i contributed in helping, i’m glad. Sure i wanted to try and do it, but i’m really better in VB.Net (even though i cant do file parser yet).

Anyway, big thanks for all your great work.

Now all that is still missing (from my point of vue) is the ability to have more skins.

Definitely your mockup was the base of our rework of the Live! and visitor log, so congratulations on suggesting this :slight_smile:

I thought by Visitor paths, you meant path stats for each page, aggregated, which is very complicated. The visitor log looks very cool now indeed!

Some people wanted to see from wich page each page was accessed. This would indeed be more complicated. But the data for it is also already in the database.
The list of action would just become something like a treeview but like i said elsewhere, it would be hard to show both the order in wich pages were visited and from wich.
Maybe one day someone will bring some fresh ideas on the matter.