Opened 3 years ago

Closed 3 years ago

#2434 closed New feature (fixed)

All API functions (including Actions.* and Goals.*) should support all segments

Reported by: msteffeck Owned by: matt
Priority: major Milestone: 1.5 - Piwik 1.5
Component: Core Keywords:
Cc: Sensitive: no

Description (last modified by matt)

Currently the Goals plugin & Actions plugin does not issue an error when given an unsupported Segment.

Change History (4)

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

  • Milestone set to 1.x - Piwik 1.x
  • Priority changed from normal to major

The list of SQL segments supported by the Goals API are:

'idvisitor',

'referer_type',
'referer_name',
'referer_keyword',
'visitor_returning',

'visitor_days_since_first',
'visitor_days_since_order',
'visitor_count_visits',
'visit_goal_buyer',

'location_country',
'location_continent',
'revenue',
'custom_var_k1',
'custom_var_v1',
'custom_var_k2',
'custom_var_v2',
'custom_var_k3',
'custom_var_v3',
'custom_var_k4',
'custom_var_v4',
'custom_var_k5',
'custom_var_v5',

We should either:

  • Make all dimensions work for Goals plugin
  • For all unsupported dimensions, return an error message "The segment 'actions' is not supported for this API call"
    • Note that, in some cases, the "per goal" metrics are not available, but the general metrics are available. For example, segment=actions>1 will return "Top keywords" but will not return "Goal X conversions /Goal Y conversion rate / Goal Z revenue" for each keyword. In this case, we shall not return an error message, but just return the common metrics not enriched with the goal details.

I vote for the solution to make all segments work for all API functions.

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

  • Milestone changed from 1.x - Piwik 1.x to 1.5 - Piwik 1.5
  • Owner set to matt

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

  • Description modified (diff)
  • Summary changed from Unsupported segments need error message to All API functions (including Actions.* and Goals.*) should support all segments
  • Type changed from Bug to New feature

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

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

(In [4717]) Fixes #2434 Now Actions.get* and Goals.get* (which were the two API not supporting all segments) have full support of all segments + adding tests

Refs #2432

  • Processing Custom vars per page: they are merged in the existing Custom Variables output (rather than create a separate one)
  • So there is no need for a new Report in the UI, Custom variables of scope "page" are displayed in the "Visitors > Custom Variables" report
  • Displaying Custom vars per page in the Live API output
Note: See TracTickets for help on using tickets.