Skip to content

Loading…

Piwik Mobile client could use the Metadata API to automatically provide all reports #1606

Closed
mattab opened this Issue · 14 comments

4 participants

@mattab
Piwik Open Source Analytics member

In Piwik 0.8, a new powerful API was release: metadata API.

The Metadata API is documented in the (new) doc page at: http://dev.piwik.org/trac/wiki/API/Metadata

The Metadata API is used to

  • get the list of all reports (category, names, API methods to call, column names, etc.) for all Piwik API reports.
  • get a specific API report data set

The Piwik Mobile would therefore not have anything hard coded (list of reports, etc.) as it would simply call the Metadata API once, cache it for the given idSite/date/period.

Then when a specific report is clicked in the Mobile UI, the API.getProcessedReport would return all data ready to be displayed in the Mobile Client.

Let me know if this makes sense.

The big advantage is that, when in the future new reports are released in Piwik, the Mobile client will automatically display these reports (translated, etc.).
This should also simplify the code and make maintenance easier.

This Metadata API is currently used to build the PDF UIs and generate PDF reports. It will also be used for the Custom Alerts plugin.

Let me know if you have any question

@tsteur
Piwik Open Source Analytics member

Hey matt,

do you have an idea why http://demo.piwik.org/?idSite=1&date=2010-12-3&apiModule=Actions&apiAction=getOutlinks&period=week&module=API&token_auth=anonymous&format=xml&language=de&method=API.getProcessedReport isn't returning any reportData?

It works if I replace the period by day: period=day

Also date=last10 isn't working. Is this as expected?

Greetz Thomas

@sgiehl
Piwik Open Source Analytics member
@tsteur
Piwik Open Source Analytics member

Hm... it works in version Piwik 1.0 even for the current week...

@tsteur
Piwik Open Source Analytics member

(In [3405]) refs #1606 use metadata api, changed statstics ui a bit, removed now deprecated files, fixed bug tableview is not clickable after changing website

@tsteur
Piwik Open Source Analytics member

(In [3406]) refs #1606 removed now deprecated translation keys

@tsteur
Piwik Open Source Analytics member

(In [3413]) refs #1606 include language in cache key

@tsteur
Piwik Open Source Analytics member

(In [3415]) refs #1606 do not crash if internet connection is not available

@robocoder

Thomas's request in comment:1 works now on the demo server. I wonder if this is the same as wheelerb's post:

I am having the same problem but it seems to come and go. Weekly totals seem to display only after the week has completed but I would like to see weekly and monthly totals part way through the time period. I am using a new install of Piwik 1.0.

@mattab
Piwik Open Source Analytics member

The issue might be that on the last day of the week, there is a bug that causes the week not to be processed for this week. I would think this is a regression since I didn't see this on the demo before, but I'm not 100% sure.

@mattab
Piwik Open Source Analytics member

For the 'report not processed' bug, I created a new ticket: #1876

Regarding using the metadata in the Piwik Mobile client, is there any issue or is it going OK?

@tsteur
Piwik Open Source Analytics member

Hi matt,

metadata in the Piwik Mobile client seems to work now. Even statistics from current week are now displayed.

@tsteur
Piwik Open Source Analytics member

(In [3429]) refs #1606 use session instead of cache

@tsteur
Piwik Open Source Analytics member

(In [3431]) refs #1606 added missing docblocks

@tsteur
Piwik Open Source Analytics member

Metadata works. I plan to add further features. For example let the user choose between different available metrics (visits, nb_visits, ...) which is currently not available. I'll create separate tickets for those features.

@mattab mattab added this to the Piwik Mobile Client milestone
@tsteur tsteur was assigned by mattab
@tsteur tsteur added this to the Piwik Mobile 1 milestone
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.