Opened 4 years ago

Closed 3 years ago

#1606 closed New feature (fixed)

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

Reported by: matt Owned by: tsteur
Priority: major Milestone: Piwik Mobile Client
Component: Core Keywords:
Cc: Sensitive: no

Description

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

Change History (14)

comment:1 Changed 3 years ago by tsteur

  • Owner set to tsteur
  • Status changed from new to assigned

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

comment:3 Changed 3 years ago by tsteur

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

comment:4 Changed 3 years ago by tsteur

(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

comment:5 Changed 3 years ago by tsteur

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

comment:6 Changed 3 years ago by tsteur

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

comment:7 Changed 3 years ago by tsteur

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

comment:8 Changed 3 years ago by vipsoft (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.

comment:9 Changed 3 years ago by matt (mattab)

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.

comment:10 Changed 3 years ago by matt (mattab)

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?

comment:11 Changed 3 years ago by tsteur

Hi matt,

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

comment:12 Changed 3 years ago by tsteur

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

comment:13 Changed 3 years ago by tsteur

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

comment:14 Changed 3 years ago by tsteur

  • Resolution set to fixed
  • Status changed from assigned to closed

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.

Note: See TracTickets for help on using tickets.