Piwik plugins define their API metadata and returns ready to be displayed reports #1485

mattab opened this Issue Jul 18, 2010 · 7 comments

1 participant

Piwik Open Source Analytics member

Required by various plugins, Custom Alerts, PDF generation, custom graph builder, etc.

It should also be used by the Mobile Piwik eventually.

Goal is to have each plugin define the list of API reports they offer:

  • group name
  • report name
  • api method & function to call to request data
  • list of metrics that will be returned + translations in requested language

Note: other plugins can add metrics to other reports too, such as the Goal plugin will add revenue/conversion/conversion rate to all segments that have this data.

Piwik Open Source Analytics member

(In [2549]) Fixes #1485

  • Adding XML export of multi dim arrays
  • Adding metadata for all plugins that define the API functions, metrics, dimensions, category, report name, metrics translations
  • Could well be extended to include 100% of Piwik report metadata later
  • cleaning up Goals API returned values to ensure consistency with other responses in piwik APIs
Piwik Open Source Analytics member

See Follow up ticket in #1491

Piwik Open Source Analytics member

(In [2594]) Refs #1485

  • Fixing wrong metadata for all plugins, cleaning up columns and ensure consistency in API (eg. VisitsSummary.get now returns conversion rate with %)
  • Adding a generic filter Truncate, updated doc at: http://dev.piwik.org/trac/wiki/API/Reference filter_truncate ; if set, will truncate the table after $filter_truncate rows. The last row will be named 'Others' (localized in the requested language) and the columns will be an aggregate of statistics of all truncated rows.
  • Adding common helpers to get a "pretty" value from a given metric and column name
  • Adding new time export format that will be used in PDF reports 12:34:56 format

Refs #1486

  • a new filter, AddColumnsProcessedMetricsGoal, can be reused to easily add processed goal metrics for a given datatable. For example: $dataTable->filter('AddColumnsProcessedMetricsGoal', array($enable=true, Piwik_DataTable_Filter_AddColumnsProcessedMetricsGoal::GOALS_FULL_TABLE)); will process all goal metrics (and per goal conv rate, rev per visit, conversions). When possible, only reports necessary should be loaded using GOALS_MINIMAL_REPORT or GOALS_OVERVIEW or a given idGoal
Piwik Open Source Analytics member

(In [2641]) Fixes some issues found in error logs when called with a previous URL format. refactored how to get arrays in API functions in a helper method. Not ideal, but better than before..
Also adding filter Truncate mentionned in refs #1485

Piwik Open Source Analytics member

(In [2663]) Refs #1485

  • Adding a magic method to request a given report but with all the metadata returned (report name, column list, translations, etc.) as well as the data, already filtered, ready to be displayed. I think this could be incredibly useful to Mobile Piwik Client!! Check out: getProcessedReport($idSite, $date, $period, $apiModule, $apiAction, $apiParameters = false)
  • This is used in the future PDF export plugin refs #5491
  • Minor updates to UI text
Piwik Open Source Analytics member

(In [2671]) Refs #1485

  • Ensuring consistency in returned data (zero values are 0% or 0). Also consistency in rounding.
  • Adding test string returned API.getReport() date + metadata for visit with goal conversion
  • Also adding logo.tpl in the release + helper method to access it (will be used to display in logo in PDF for example. Could later be customizable per-site or globally eg.)
Piwik Open Source Analytics member

(In [2746]) Refs #1485 Better reports/column order in Metadata response + fixing small issues with metadata

@mattab mattab added this to the Piwik 0.6.4 milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment