matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.9k stars 2.65k forks source link

A simple datatable for visits summary #9585

Open NicoDuclos opened 8 years ago

NicoDuclos commented 8 years ago

I couldn't find a way to display a simple datatable of the visits summary.

You can display a datatable of visits by country (in visitors location) or by device or ... But visits overview can not be display in a data table.

I would like an overview like that :

screenshot_visits_overview_datatable

So I could use the power of insights and get a quick view of the visits of the day (for example) and have a comparison of yesterday :

screenshot_visits_overview_insights

tsteur commented 8 years ago

True, we do not have such a report yet. This would be a new feature that could be alternatively also developed in a plugin but may be not trivial.

tsteur commented 8 years ago

A workaround for now would be to call the API manually and get it as XML, JSON, CSV, ...

http://demo.piwik.org/index.php?module=API&method=Insights.getInsights&reportUniqueId=VisitsSummary_get&idSite=7&period=day&date=yesterday&format=JSON&token_auth=anonymous

From the docs:

  • Insights.getInsights (idSite, period, date, reportUniqueId, segment = '', limitIncreaser = '5', limitDecreaser = '5', filterBy = '', minImpactPercent = '2', minGrowthPercent = '20', comparedToXPeriods = '1', orderBy = 'absolute')

In this case it shows two entries. The first entry is yesterday, the second entry is the entry the first entry is compared to (the day before in this case).

To get it eg as CSV specify &format=CSV

hpvd commented 8 years ago

+1 this one would also help to get a fast overview of total data https://github.com/piwik/piwik/issues/9109

NicoDuclos commented 8 years ago

@hpvd I totally agree. With this presentation you have a really fast overview of the visits.

@Tsteur Thank you for the workaround. Unfortunately datas from this API call seems wrong.

I get this result from the request you proposed :

[
  {
    "nb_visits":1072,
    "growth_percent":"100%",
    "growth_percent_numeric":"100",
    "grown":true,
    "value_old":0,
    "value_new":1072,
    "difference":1072,
    "importance":1072,
    "isDisappeared":false,
    "isNew":true,
    "isMover":false,
    "isMoverAndShaker":false
  },
  {
    "nb_visits":950,
    "growth_percent":"-100%",
    "growth_percent_numeric":"-100",
    "grown":false,
    "value_old":950,
    "value_new":0,
    "difference":950,
    "importance":950,
    "isDisappeared":true,
    "isNew":false,
    "isMover":false,
    "isMoverAndShaker":false
  }
]

value_old is 0 so growth_percent is 100

tsteur commented 8 years ago

It's possible it doesn't really work for *.get reports like VisitsSummary.get since they are a little different from normal reports. It would need to be developed.