Opened 14 months ago

Closed 6 months ago

Last modified 6 months ago

#3786 closed New feature (fixed)

MultiSites.getAll: Add option to not remove sites that have no visits

Reported by: tsteur Owned by: tsteur
Priority: major Milestone: 2.0 - Piwik 2.0
Component: Core Keywords:
Cc: Sensitive: no

Description

I'm using MultiSites.getAll for the "All websites dashboard" in new Piwik Mobile app to have same behavior as in Piwik (if MultiSites is enabled by user in settings defaultReport).

If one calls MultiSites.getAll the API will remove websites having 0 visitors. See:
https://github.com/piwik/piwik/blob/master/plugins/MultiSites/API.php#L300

This can result in no displayed websites in the "All Websites Dashboard". -> User can not select a website, can not pick another date or anything else. A user can simply not use the app if no website has a visitor yet.

Is it possible to add an option so that websites having no visitors won't be removed?

Change History (16)

comment:1 Changed 14 months ago by matt (mattab)

  • Milestone changed from 1.12.x - Piwik 1.12.x to 1.12 - Piwik 1.12

comment:2 Changed 13 months ago by matt (mattab)

  • Owner set to mattab
  • Resolution set to fixed
  • Status changed from new to closed

In d88521348b5c679a767c322d7edb9e24f929e5c4:

Fixes #3786 Little hack for Piwik Mobile. You can now pass &enhanced=1 and it will return more metrics + will _not_ remove the websites without visits

comment:3 Changed 9 months ago by tsteur

In a5be1e050f1819029d2f5158054356cb216d5fe4/piwikmobile2:

set enhanced parameter to prevent removing websites which have no visits, see #3786 . Unfortunately the enhanced parameter seems not to work, will have a deeper look later

comment:4 Changed 9 months ago by tsteur

  • Resolution fixed deleted
  • Status changed from closed to reopened

@Matt I reopen this ticket. It seems not to work for me. Maybe because of this? https://github.com/piwik/piwik/blob/master/core/DataAccess/ArchiveWriter.php#L214 Not sure. I have a fresh installation of Piwik here and I get the websites only when switching the period to year because there were only some visitors about a month ago.

Setting the enhanced parameter to 1/true has no effect.

comment:5 Changed 9 months ago by tsteur

FYI: Two beta testers have reported problems when the enhanced parameter is enabled (Piwik 1.12):

PHP Fatal error: Call to undefined method Piwik_DataTable_Array::getRows() in /home/***/public_html/***/plugins/MultiSites/API.php on line 256

comment:6 Changed 9 months ago by matt (mattab)

  • Milestone changed from 1.12 - The Great 1.x Backlog to 2.0 - Piwik 2.0

comment:8 Changed 6 months ago by matt (mattab)

  • Owner mattab deleted
  • Status changed from reopened to new

comment:9 Changed 6 months ago by tsteur

create a new website and have a look whether it gets returned by MultiSites.getAll

comment:10 Changed 6 months ago by tsteur

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

comment:11 Changed 6 months ago by tsteur

In 7e5becd8df89b9bd1261b6fa10b36252536273bf:

refs #3786 let the build fail by expecting MultiSites.getAll works with daterange and returns websites having 0 visits

comment:12 Changed 6 months ago by tsteur

In f1b47f64deef34b7ab916b68d2ef2badd2d8cca1:

refs #3786 fix websites having 0 visits are not returned, fix MultiSites.getAll does not work with dates like last7

comment:13 Changed 6 months ago by tsteur

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

comment:14 Changed 6 months ago by tsteur

In a841abcc3e146f7f554928c73605cb005452ab27:

refs #3786 make sure a website is set in case only one website is requested

comment:15 Changed 6 months ago by tsteur

In 8ae00385469e3798b8bae25b715e0b36189b8073:

refs #3786 MultiSites.getOne should return website even if there are no visits

comment:16 Changed 6 months ago by tsteur

In 2a152563736237ba3a33909d2e91b45590b93476:

refs #3786 fix MultiSites.getOne week integration test

Note: See TracTickets for help on using tickets.