@mattab opened this Issue on February 6th 2014 Member

The goal of this ticket is to create a mechanism to let user view the Visitor Log report filtered to only show visitors matching a given criteria that the Piwik user is interested in.

In particular, in each datatable report that supports it, eg. in the Browsers table, next to the labels eg. "Firefox 33" there is an icon. On click, it opens a popover that shows all visitors that match the segment 'visitor uses browser firefox 33'.

Another example: viewing the custom variables report you can directly see all users using this particular custom var. Will work the same for Screen resolutions, Keywords, campaigns or any other report.

  • [x] API: Update Metadata APIs to include the information whether a particular metadata report is linked to a segment. For example Referrers.getKeywords returns data from the segment keyword.
    • Proposed: Add a new "segment" entry in the metadata array
  • [x] For each datatable row, if necessary, include the segment value that will match this row (in case it's not simply the label value eg. for browsers a code is used)
  • [x] UX: Add new icon in all report tables. The icon is added for all reports where the metadata indicates the report has an equivalent "segment".
  • [x] The icon has a tooltip such as "View all Visitors with this Keyword" or "View all visitors who visited this Page URL".
  • [x] When clicked, the Visitor Log, segmented to show only those matching the clicked row label, are displayed in the popover.
    • The popover should have meaningful title,
    • maybe include the Segment Editor pre-set to this custom segment?,
    • display the current segment value eg. Browser is 'Firefox 33'

The Visitor Log is filtered to show only visitors matching a given segmentation string: learn more about segmentation capability of Piwik. Our Metadata API also is full featured and in many ways useful.

For this issue we will

  • extend the metadata API to make it provide a new flag that says whether the report supports segmentation.
  • provide for each row, the segment value that will match this particular row / dimension.

Note: this was inspired from the plugin in #3861

@mattab commented on December 1st 2014 Member

This whole feature would ideally be added in a new plugin eg. SegmentOneClick

@tsteur commented on January 28th 2015 Member

Be aware that some reports have multiple segments, eg UserCountry:

segments: ["countryCode","continentCode"],

In this case we will use the first one. It is not guaranteed that the correct one is always defined first but must do for now

@tsteur commented on January 29th 2015 Member

I created an issue asking designers to create icons for it

@tsteur commented on February 1st 2015 Member

I will stop working on this issue and discuss further steps with @mattab as a generic solution seems to be not possible. Might work with some changes to Segmentation but then there would be still problems eg how to get the Segmentation display name when a subtable is requested (eg 'test' in '/foo/test' should display '/foo/test' in segmentation title and not only '/test' in case of a subtable). Also metadata in API response gets pretty big etc. Manually defining the segmentation value in row metadata with additional filters is quite hard as well.

@mattab commented on February 9th 2015 Member

It's very good we're making progress on this awesome feature. It will take more time to get it right but it's really worth the effort :-) When you have time maybe you can list the next actions and blockers and we will hopefully be able to solve in next few sprints. Exciting!

@mattab commented on February 13th 2015 Member

Amazing feature!

Feedback (WIP):

  • I want to open the Visitor profile from the popover -> how could we make this work well?
  • I somehow want to create in one click, a segment like the one used in the popover, to learn more about this segment of visitors
  • maybe i want to click on the popover somewhere so it opens the visitor log in the main window rather than the popover
  • Rows with Unknown (eg. unknown cities, regions) don't have the icon
@mattab commented on February 13th 2015 Member

Got this error:

  • ERROR VisitTime[2015-02-13 11:28:40] [12652] Failed to get data from API: Date format must be: YYYY-MM-DD, or 'today' or 'yesterday' or any keyword supported by the strtotime function (see http://php.net/strtotime for more information): #0 /home/piwik-demo/www/demo.piwik.org/core/Date.php(128): Piwik\Date::getInvalidDateFormatException(false) #1 /home/piwik-demo/www/demo.piwik.org/plugins/VisitTime/API.php(63): Piwik\Date::factory('previous7') #2 [internal function]: Piwik\Plugins\VisitTime\API->getVisitInformationPerServerTime('1', 'range', 'previous7', false, '1') #3 /home/piwik-demo/www/demo.piwik.org/core/API/Proxy.php(211): call_user_func_array(Array, Array) #4 /home/piwik-demo/www/demo.piwik.org/core/API/Request.php(231): Piwik\API\Proxy->call('\Piwik\Plugins...', 'getVisitInforma...', Array) #5 /home/piwik-demo/www/demo.piwik.org/core/ViewDataTable/Request.php(48): Piwik\API\Request->process() #6 /home/piwik-demo/www/demo.piwik.org/core/Plugin/ViewDataTable.php(327): Piwik\ViewDataTable\Request->loadDataTableFromAPI(Array) #7 /home/piwik-demo/www/demo.piwik.org/core/Plugin/Visualization.php(177): Piwik\Plugin\ViewDataTable->loadDataTableFromAPI(Array) #8 /home/piwik-demo/www/demo.piwik.org/core/Plugin/ViewDataTable.php(414): Piwik\Plugin\Visualization->buildView() #9 /home/piwik-demo/www/demo.piwik.org/core/Plugin/Report.php(317): Piwik\Plugin\ViewDataTable->render() #10 /home/piwik-demo/www/demo.piwik.org/core/Plugin/Controller.php(328): Piwik\Plugin\Report->render() #11 /home/piwik-demo/www/demo.piwik.org/plugins/VisitTime/Controller.php(24): Piwik\Plugin\Controller->renderReport(Object(Piwik\Plugins\VisitTime\Reports\GetVisitInformationPerServerTime)) #12 [internal function]: Piwik\Plugins\VisitTime\Controller->index() #13 /home/piwik-demo/www/demo.piwik.org/core/FrontController.php(583): call_user_func_array(Array, Array) #14 /home/piwik-demo/www/demo.piwik.org/core/FrontController.php(96): Piwik\FrontController->doDispatch(NULL, NULL, NULL) #15 /home/piwik-demo/www/demo.piwik.org/core/dispatch.php(31): Piwik\FrontController->dispatch() #16 /home/piwik-demo/www/demo.piwik.org/index.php(27): require_once('/home/piwik-dem...') #17 {main}
@tsteur commented on February 13th 2015 Member

Re Feedback (WIP)

I suggest to create new issues for all those.

Rows with Unknown (eg. unknown cities, regions) don't have the icon

That's currently on purpose as some segments don't work when passing an empty label eg deviceType== shows "Unknown" and "Desktop". So for the first version the easiest way is to disable it for them instead of showing wrong results in the visitor log. In the next step we can fix the actual segments.

@tsteur commented on February 13th 2015 Member

The visitTime error is fixed in a new branch, will pull request once tests are green

@mattab commented on February 15th 2015 Member

Further feedback:

  • When clicking in a sub-table such as Event subtable, the popover such as this one says Visitor Log showing visits where is "click" but we expected to be Visitor Log showing visits where Event action is "click"
  • The following reports don't have an icon as they don't have yet a segment. We need to create a segment for these:
    • Device brand
    • Device model
    • Browser language
    • Custom Variables will require a new "generic" custom variable segment, covered in #6031
    • Outlinks and Downloads, requires #4103
  • Icon doesn't display in the following reports
    • Provider (segment provider)
    • Visits per visit duration (segment visitDuration)
    • Visits by Visit Number (segment visitCount)
    • Visits per number of pages (segment actions)
    • Visits by days since last visit (segment daysSinceLastVisit)
    • Page title (segment pageTitle)
    • Site Search (segment siteSearchKeyword)
    • Referrer type (segment referrerType)
  • The popover does not show data when a URL contains exotic characters eg in this report the popover does not show data for /piwik日本ユーザー会について, this is the loaded popover URL
  • In the "Referrers > Search engines" the Keyword not defined popover shows all kinds of referrers. Maybe it should segment for Visitors with referrerType==search
  • Could we display the icon in the sub-tables of the "Referrers" reports such as Search engines, Search keyword, Websites URLs and Campaign keywords

(I'll create issues for those if you want)

@tsteur commented on February 15th 2015 Member

If a segment exists but doesn't show in UI it is either define in /core and not in the column directly, or the dimension is not linked with a report, or it is not easy to implement eg in case of pageTitles as it has weird subtables constructions but no url metadata. You can create separate issues for all those.

Re search engines will see if it is possible to disable it for Keyword not defined unless segments support to filter exactly this. Filtering for referrerType==search would be wrong.

Displaying them in subtables would be a new issue as well as the others.

Re event action this looks like a regression, it was not supposed to be displayed in the subtables there and will remove it again.

I will have a look re the exotic characters but already mentioned to you last week that there is a problem and how Piwik stores them etc.

@tsteur commented on February 15th 2015 Member

Re search engine I think what you meant is we always need to append/prepend referrerType==search to all of the segment filters

@mattab commented on February 15th 2015 Member

Created follow up issues:

  • Display the "Segmented Visitor Log" icon in more reports #7212
  • Display the "Segmented Visitor Log" icon in sub-tables reports #7213
  • In the Segmented Visitor Log, let me open in a new tab the Piwik UI with the custom segment applied #7215
  • In the Segmented Visitor Log, let me open the Visitor Profile #7214
@mattab commented on February 15th 2015 Member

Re event action this looks like a regression, it was not supposed to be displayed in the subtables there and will remove it again.


This Issue was closed on February 16th 2015
Powered by GitHub Issue Mirror