So I was trying to figure out a way to show charts with PiWik without allowing anonymous access to my stats. I wanted to show some stats but not all of them yet

!
Here is a live Google Spreadsheet Chart using PiWik data:
So how do you do it? You need Google spreadsheets and use their importXML function. I made the above chart to show the last 5 days of activity.
In column A, put the function =Today() in A5 and then in a4 use =a5-1 and copy that to A3,A2,A1. That puts the dates in the right format.
In column B, you will use the importXML function. The XML is using PiWik's awesome API. Here is the sample that I am using:
Quote:
|
http://www.branica.com/piwik/index.php?module=API&method=VisitsSummary.get&idSi te=1&period=day&date=today&format=xml&token_auth=y our token
|
You need to replace "date=today" to "date=A5" as a example for B5. Here is the complete forumla for cell B5 that references A5:
Quote:
|
=ImportXML("http://www.branica.com/piwik/index.php?module=API&method=VisitsSummary.get&idSi te=1&period=day&date="&A5&"&format=xml&token_auth= your token","//nb_visits")
|
//nb_visits is the node in the xml tree that gets you the number of visitors for the day.
And with Google Spreadsheets & PiWik, it is all dynamic! You can try out
PiWik at Branica if you don't want to install on your server.