@DaSchTour opened this Issue on April 20th 2015 Contributor

Similar to the possibility google analytics offers it would be great, if piwik would allow to compare segments. I searched for a similar issue but couldn't find it. So hopefully this isn't a duplicate.

@mattab commented on April 21st 2015 Member

@DaSchTour absolutely, ability to compare the same data set for 2 segments, in the same data table, would be awesome!

it's related / similar to the ability to compare two different date perids for the same report(s) in #5711 as in google analytics and other advanced analytics tools

Related to comparing dates as well (since both would use same mechanism) https://github.com/piwik/piwik/issues/5711

@tsteur commented on January 24th 2019 Member

Unassigning myself for now as I'm not sure when I find time to work on it again. Started work on it here: https://github.com/matomo-org/matomo/compare/5711

Done so far:

  • For regular data tables support date1=&period1= for date comparison, as well as &segment1=...&segment2=&segment3=&segment4= for segment comparison. both can be used together
  • Adjusted date selector to support comparisons (not fully finished eg compare date needs to adjust automatically depending on selection of comparison period and selected period etc)
  • When comparing data, we automatically flatten the data (at least for now)... maybe some reports want to define different behaviour and only work on first row level data (eg acquisition websites, etc)
  • Data structure looks like
    • Label1
      • Date1 (present if comparing date)
        • Segment1 (present if comparing segment)
        • Segment2 (present if comparing segment)
      • Date2 (present if comparing date)
        • Segment1 (present if comparing segment)
        • Segment2 (present if comparing segment)
    • Label2
      • ....

To be done:

  • Add comparison selection to segment selector: We would only allow to compare to other already created segments
  • In API response I currently set the segment expression in the API output as label but would need to show ideally the segment name if the segment expression is found
  • Need to automatically expand all rows in html table when comparing data? not sure...
  • Define how API output could look like when using simple datatable (sparklines, evolution graph)
  • Support comparison for bar, pie, ... charts
  • Support comparison for evolution graphs
  • Support comparison for sparklines
  • Support comparison ideally in row evolution
This Issue was closed on September 30th 2019
Powered by GitHub Issue Mirror