Segmentation: implement UI for adding/editing segments, and switching segments
|Reported by:||matt||Owned by:||matt|
|Priority:||critical||Milestone:||1.12 - The Great 1.x Backlog|
Description (last modified by matt)
Piwik now support full segmentation via the API only: http://piwik.org/docs/analytics-api/segmentation/
We want to be able to
- Create segments
- define the conditions AND / OR
- pick metric
- pick match (equals, contains, etc.)
- pick value
- give the segment a name
- Segment is created inside the "report" UI like Goals
- define the conditions AND / OR
- Test Segment in real time (fetch number of visits for it). Just calls the API with segment= and fetches number of visits.
- Edit segment: UI page resets to current segment definition
- Build the feature to autocomplete when filling a value for a given dimension/metric, for efficiency and ease of use. Reuse the code in getLabelsFromTable()
- For metrics, when the value in the filter is not numeric, throw an error
Also, when creating a segment, you can add check 2 boxes
- Add to my segment list (checked by default - available only to user who creates it)
- Add to this website segment list (viewable by all & editable by all users with admin on this site)
- For super user, "Add this to all websites segment list".
Segment definitions are stored in a new 'segment' table, which contains the creator user login, idsites the segment appears in.
In the super user case, the segment will have a flag "idsites" = "all".
- Archive.php: update to pre-process segments created for a particular website. call API to get per-site segments. Let user disable this with config setting.
In the Reporting UI, there would be a new box probaby similar to current Calendar / Info box that would list the current Segment applied to the data.
It would open up (similarly to the calendar) to show the list of pre-created segments, or the "Add a new segment" link.
User can then click on the Segment link to ajax reload the report with the segment applied to all visible reports.
The list of segment will lists all Websites segment first, then all User segments.
Note: some of the UI logic to define segment can be similar to the one used to define custom alerts (#1486), in particular the "value" ajax suggestion would reuse the same code.
GA supports visitsToTransaction and daysToTransaction - is it equivalent to "visitConverted==1;daysSinceFirstVisit==X" ? maybe not
Summary: the UI will allow to create/edit/delete segments, we will add a new box next to the calendar to select currently applied segments.
BUGS to fix
At the same time, it would be nice:
In the V1, we will not compare the Segment data with the "All visits" data or allow to compare segments together. This feature would be very nice and is important to have, see also ticket to compare several date ranges #291
I will ask Marcin to provide some mockups for the screens of this feature. Once we have them we can implement this new UI element.
Please post here any idea/feedback!
Change History (51)
comment:10 Changed 2 years ago by matt (mattab)
- Milestone changed from 1.x - Piwik 1.x to 1.7 Piwik 1.7
comment:17 follow-up: ↓ 18 Changed 13 months ago by matt (mattab)
comment:21 Changed 9 months ago by matt (mattab)
- Milestone changed from 1.12.x - Piwik 1.12.x to 1.12 - Piwik 1.12
comment:22 Changed 9 months ago by matt (mattab)
- Owner set to matt
comment:30 follow-ups: ↓ 34 ↓ 35 Changed 8 months ago by peterb (peterbo)
comment:40 Changed 7 months ago by peterb (peterbo)
comment:49 Changed 7 months ago by matt (mattab)
- Resolution set to fixed
- Status changed from new to closed