Custom (?) Joomla integration questions

Hi folks. To those of you responsible (since this is my first post to the forums) thank you very much for Piwik :slight_smile:

I may want to write a Joomla extension to query Piwik so that I can promote a Guest user to a secondary Guest Group/ACL combo, for purposes of showing certain things only to repeat public gawkers.

Regarding the Piwik side of that, where do I start reading?

Some specifics about the kind of implementation, to help you help me…

I don’t need this to work with Piwik and Joomla on separate hosts – same host being required e.g. for purposes of getting session/cookie vars etc, is fine – and I’m comfortable writing database queries and PHP code generally.

All I really need to know at the mo’ is two variables:

  • how many clicks this visit
  • how many visits this visitor’s known history

Danke mucho!

Hi there,

Maybe start with the Analytics API doc if it helps? Piwik Analytics API - Analytics Platform - Matomo

Matt,

Thanks for your reply.

I am very bad at reading API manuals without a fairly relevant tutorial. Is there any hope I could ask for a tiny bit of sample code or just a couple specific URL pointers in the API docs? Here is whole-cloth pseudocode for what I want to do:

$obj = PiwikFactory::getCurrentVisit();
$v = $obj->getUser()->getVisitCount(); // how many tracked visits from this visitor?
$a = $obj->getActionCount(); // how many clicks has this visit entailed

I would be happy to buy you a beer for specific pointers on fetching those two variables without affecting tracking.

Nevermind - I think between having access to the cookie, and having found the database info, I may be good :slight_smile: