Closed Bug 1029776 Opened 6 years ago Closed 6 years ago

[Search experiment] Create experiment add-on and define user group (cell) on installation

Categories

(Firefox :: Search, defect)

defect
Not set
Points:
5

Tracking

()

RESOLVED FIXED
Iteration:
33.2

People

(Reporter: Felipe, Assigned: Felipe)

References

Details

Create the basic structure for the experiment add-on, and on installation, define the user group (using the experiment branch mechanism from bug 1017806) as follows:

- Users who don't have Google as the default search provider: put it on group 6
- Users who have customized away the search box in the URL bar: put it on group 6

For all other users, make a random draw to produce an equal sampling between 5 groups, and put them in the chosen group. The meaning of each group is explained in bug 1029263.

If the experiment has been disabled and reenabled, the defined group for that user shouldn't change.
Blocks: 1029783
Summary: Create experiment add-on and define user group (cell) on installation → [Search experiment] Create experiment add-on and define user group (cell) on installation
Depends on: 1029792
Additional requirement: Every member of every cell must have used firefox at least once a week for the past four weeks
Flags: firefox-backlog+
(In reply to :Felipe Gomes from comment #1)
> Additional requirement: Every member of every cell must have used firefox at
> least once a week for the past four weeks

This function can be used as the experiment jsfilter function to determine if firefox was used at least once per week:

>function filter(a, healthReportPayload, c) {
>  if (healthReportPayload.version < 2 ||
>      !healthReportPayload.data.days) {
>    return false;
>  }
>
>  const ONE_DAY = 60 * 60 * 24 * 1000;
>  let today = new Date();
>
>  function daysAgo(n) {
>    // toISOString().substr(0, 10) is the same implementation
>    // that FHR uses
>    return (new Date(today - n * ONEDAY)).toISOString().substr(0, 10) 
>  }
>
>  function week(start, end) {
>    for (let i = start; i <= end; i++) {
>      yield daysAgo(i);
>    }
>  }
>
>  let days = healthReportPayload.data.days;
>  return
>    [day for each (day in week(1, 7))].some(day => day in days) &&
>    [day for each (day in week(8, 14))].some(day => day in days) &&
>    [day for each (day in week(15, 21))].some(day => day in days) &&
>    [day for each (day in week(22, 28))].some(day => day in days)
>}

It should be easy to convert it to run from inside the experiment if we want to tag these users in a specific cell. But it's slightly convenient to run it from the jsfilter because the FHR payload is already passed as a parameter (and also it can be reevaluated every day to see if the user becomes a candidate)
Start of work here:
https://hg.mozilla.org/users/felipc_gmail.com/search-experiment
Assignee: nobody → felipc
Status: NEW → ASSIGNED
Added to Iteration 33.2  Can you provide a point value and if the bug should be marked as [qa+] or [qa-] for verification.
Iteration: --- → 33.2
QA Whiteboard: [qa?]
Flags: needinfo?(felipc)
I'm setting qa- because there's an overall bug about testing the add-on, bug 1029818, and it doesn't make much sense to test piecewise.
Points: --- → 5
QA Whiteboard: [qa?] → [qa-]
Flags: needinfo?(felipc)
Depends on: 1031320
Amendment to Acceptance criteria:

*Each of the five cells should contain 10% of the EN-US Beta population.
Work done at https://hg.mozilla.org/users/felipc_gmail.com/search-experiment and to be reviewed through
bug 1029818
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.