Opened 12 months ago

Closed 12 months ago

Last modified 12 months ago

#3906 closed New feature (fixed)

New API: getSuggestedValuesForSegment to return top suggested values for a particular segment

Reported by: matt Owned by: mattab
Priority: major Milestone: 1.12 - The Great 1.x Backlog
Component: Core Keywords:
Cc: Sensitive: no


For the segment editor #2135 and for custom alerts #1486 we need an API that returns the suggested values for a given segment.

The API should be simple to use and fast, and return a plain list of unique strings that have been used for the request segment, to assist users in creating segments.

Change History (3)

comment:1 Changed 12 months ago by matt (mattab)

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

In 35f975accb45152dd669e0009237eed3dc6ada2b:

Fixes #3904:

  • new segment 'siteSearchKeyword'

Fixes #3903, #3905:

  • adding few fields in the Live API output to accomodate getSuggestedValuesForSegment
  • renamed other fields for consistency with segment names

Fixes #3906:

  • new API: getSuggestedValuesForSegment which returns top suggested values for a particular segment. It uses the Live.getLastVisitsDetails API to fetch the most recently used values, and will show the most used values first
  • Adding tests for everything. The test case actually generates data for all segments so that VisitsSummary.get returns some data for each of the 47 segments being tested returns some data. How it works:
    • generate extended data in fixture
    • Tests (1) call getSuggestedValuesForSegment for each segment, check there is some data returned for each segment
    • get the first suggested value from the list,
    • Tests (2) call VisitsSummary.get with this segment value, eg. countryCode==ru.
      • I worked this way for all 47 segments until all tests had some data ==> now we know that all segments have been tested and that the auto suggest works for all segments. TDD FTW!

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

In ea240af531caeb85a9fec84c05b2714216175156:

Refs #3906

  • Speeding up the suggestion list by only requesting actions when they are really needed

comment:3 Changed 12 months ago by matt (mattab)

In 3069828eff80e45a5f9ce661729adcebbb70fa6c:

Refs #3906

  • Speeding up the suggestion list by only selecting visitors that have a value set for the requested segment
Note: See TracTickets for help on using tickets.