Opened 2 years ago

Closed 2 years ago

#2895 closed New feature (fixed)

New reports: Browser and Operating system market shares

Reported by: matt Owned by:
Priority: critical Milestone: Piwik 1.8
Component: UI - UX (AngularJS, twig, less) Keywords:
Cc: Sensitive: no

Description (last modified by matt)

Currently Piwik reports

  • Browser family, Gecko VS Webkit VS IE vs Opera: useful for web developers since the engine impact the way pages are rendered
  • Browser versions: FF 8, IE 7, etc. Useful to know exactly what browsers are used

It would be nice to also provide Browser marketshare: FF Vs IE Vs Opera Vs Chrome Vs Safari Vs others.

  • This would be useful to answer the general geek question "Who is winning?"
    • It might be a bit too much to yet another report about browsers in Visitors > Settings report already a bit crowded.
    • Maybe The User Interface could be a button to access the other report, in a footer message for example "Switch to Browser Marketshare report" / "Switch to Browser versions report"
    • The report would be aggregated from the Browser versions datatable and in fact will be a "View" of this other report. It will not require a new archiving process. The API will call std API and extract browser name and re-aggregates.

This would be IMO a very useful new Piwik report and would not clutter the UI.

This ticket also includes similar work for Operating System Marketshare

  • By default, show Windows XP VS Mac OS X VS Windows 7 VS Android
  • An icon or link allows to display Windows VS Mac VS Linux
  • the new API is simply a view aggregating the existing API
  • there can be new integration tests for the 2 new API functions

Attachments (3)

UserAgentParser_patch.php (1.2 KB) - added by macitbetter 2 years ago.
2895.diff.tar.gz (6.6 KB) - added by capedfuzz 2 years ago.
Patch for this issue.
2895.diff.tar.2.gz (8.3 KB) - added by capedfuzz 2 years ago.
Patch for this issue and issue #3133.

Download all attachments as: .zip

Change History (16)

comment:1 Changed 2 years ago by matt (mattab)

  • Description modified (diff)

comment:2 Changed 2 years ago by matt (mattab)

  • Summary changed from New report: Browser market share to New reports: Browser and Operating system market shares

We could similarly provide the OS Market share report: Windows VS Mac VS Linux VS Blackberry.

I think that this could be done by simply "aggregating" All windows version together?

Once we do this, it could be relevant to provide breakdown of Mac OS X versions, similarly to the breakdown of Windows versions?

Changed 2 years ago by macitbetter

comment:3 Changed 2 years ago by macitbetter

The patch above splits Mac OS X into its various major versions.

comment:4 Changed 2 years ago by matt (mattab)

  • Milestone changed from 1.x - Piwik 1.x to 1.8 Piwik 1.8

It would be nice to do this early rather than later.

It's kind of annoying to see Chome 16 topping the reports just because their updater virus automatically updates everyone ;)

PS: I call the googleupdater.exe virus because I cant get rid of it on my computer, even deleting the scheduled updating task, it's then automatically re-created...

comment:5 Changed 2 years ago by matt (mattab)

  • Priority changed from major to critical

comment:6 Changed 2 years ago by matt (mattab)

  • Description modified (diff)
  • Milestone changed from 1.8 Piwik 1.8 to 1.7.x - Piwik 1.7.2

Changed 2 years ago by capedfuzz (diosmosis)

Patch for this issue.

comment:7 Changed 2 years ago by capedfuzz (diosmosis)

I've attached a patch for this issue. It adds a two new reports. Notes:

  • This patch includes the GroupBy filter from my patch in #3004 and the related reports code from #3137.
  • I only added one new report for operating systems: getOSFamily. The possible families are in UserAgentParser.php.
  • For the browser report, I modified the existing one to be getBrowserVersion and then added getBrowser. So the browser version report is no longer displayed by default.
  • For the browser report's metadata, I modified the existing metadata entry. There was a comment that said it was only used to define a segment. I'm not sure if modifying this was the correct path, though.

Changed 2 years ago by capedfuzz (diosmosis)

Patch for this issue and issue #3133.

comment:8 Changed 2 years ago by capedfuzz (diosmosis)

I uploaded an updated patch for this issue. This patch has another report, getDeviceType, which is meant to solve #3133. The report differentiates between desktop OSes, mobile OSes and gaming consoles. The report is set as a related report for the Operating Systems section (not sure where else to put it).

Let me know what you think.

comment:9 follow-up: Changed 2 years ago by matt (mattab)

Great patch!! :)

Review

  • plugins/UserSettings/UserSettings.php should also leave the existing widget for "Browser versions" in case users want to embed this widget in their site/app. Currently only the new getBrowserVersion is available as widget
  • did you check new reports work OK in HTML/PDF reports?
  • Piwik core will rely on UserAgentParser english strings. Can you add a comment in UserAgentParser saying eg. "NOTE: don't change any of these or update also code in plugins/UserSettings/functions.php" to make sure we don't forget about it (or changing 'gaming console' to 'gaming' for example would lead to a lot of 'unknowns'
  • WII icon looks better than PS3 imho could we use it for 'gaming' ?
  • in tests/integration/expected/test_OneVisitorTwoVisitsUserSettings.getOSFamily_day.xml the <shortLabel> should be "Win" instead of "Win XP"
  • in +++ tests/integration/expected/test_OneVisitorTwoVisitsUserSettings.getDeviceType_day.xml shortLabel should be Desktop instead of Win XP
  • I didn't check in detail the OS => OS family table - but it looks good

Thanks for these very useful new reports, that users will really appreciate!

comment:10 in reply to: ↑ 9 Changed 2 years ago by capedfuzz (diosmosis)

Replying to matt:

Great patch!! :)

Review

  • plugins/UserSettings/UserSettings.php should also leave the existing widget for "Browser versions" in case users want to embed this widget in their site/app. Currently only the new getBrowserVersion is available as widget

Not sure what you mean by this. Do you mean, leave the getBrowser method as it was before (when it reported browser versions)?

comment:11 Changed 2 years ago by matt (mattab)

I meant that getBrowserVersions and getBrowser should each be available as a widget in the array that defines widgets in UserSettings.php

comment:12 Changed 2 years ago by matt (mattab)

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

looking forward to it :)

comment:13 Changed 2 years ago by capedfuzz (diosmosis)

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

(In [6326]) Fixes #2895, #3133, renamed existing report getBrowser to getBrowserVersion, added 3 new reports, getBrowser (browser w/o version), getOSFamily and getDeviceType.

Notes:

  • Modified MetadataCallbackReplace & ColumnCallbackReplace so extra columns could be passed to the callback, w/o being replaced.
  • Modified UserAgentParser.php to provide operating system family extraction functionality.
Note: See TracTickets for help on using tickets.