Database call personalization



I need some data from the database and am trying to use Piwik’s existing methods. In particular, I worked now for a while with the getLastVisitsDetails to get what I need. E.g;

$requestLastVisits = ‘method=Live.getLastVisitsDetails

Now the thing is, there is a massive amount of data I get when making this call. There are actually many column I could drop as I don’t use them.
For now, I am filtering in PHP but I was wondering whether
a) there is some solution here (maybe with segments?)
b) I should write my own sql calls if I want some precise data
( c) doing this in PHP is ok)

As for the ordering, is there a way to define the column to sort on when using this function?

(Matthieu Aubry) #2

you can use parameters showColumns and hideColumns


Thx Matt for your help,

I come back to this db call, as I still have to juggle to get what I really need.
In particular, I cannot find any way to get the server time of a row in ActionDetails, see you xml example ( from the LiveAPI, in which the action details look like the following:

  <pageTitle>Piwik Forums</pageTitle>
  <serverTimePretty>Wed 5 Feb 14:36:26</serverTimePretty>
<row>NEXT ROWS</row>

So there is the server time, but only as pretty and I cannot find a way to get this time as the clean timestamp.
Right now I parse it, but this is really not a viable solution (serverTimePretty is different in every language, etc)

Thanks in advance for your help !

(Matthieu Aubry) #4

So it looks like the timestamp is missing, maybe we could add it? if so please create a feature request at