Getting 'unique visits over time' from a plugin


#1

Hello,

What is the best way to query the Piwik data to retrieve the data over a time-period in incements?
For example, the daily number of visits for the last week?

As far as I can tell, the only way to query the visits data is via the VisitsSummary, which only produces summary (the total number of visits for the last week).

I can call the VisitsSummary API several times, once for each day in the last week, but is there a more elegant way for getting the data?

Thanks,
mv


(Stefan Giehl) #2

Do you mean something like tihs:

http://demo.piwik.org/index.php?module=API&method=VisitsSummary.getUniqueVisitors&idSite=7&period=day&date=last10&format=xml

or for custom date ranges:

http://demo.piwik.org/index.php?module=API&method=VisitsSummary.getUniqueVisitors&idSite=7&period=day&date=2014-07-01,2014-07-31&format=xml


#3

Exactly like that, thank you very much!!

So the “date” specifies the date range (“last10”, “2014-07-01,2014-07-31” etc),
and “period” represents the period (“day”, “week” etc).

That’s exactly what I needed, thank you.