Page MenuHomePhabricator

Provide a reusable getEditCountBucket function for analytics purposes
Open, Stalled, NormalPublic5 Story Points

Description

Bucketing users into edit-count buckets is a strategy used by QuickSurveys, Popups

https://github.com/search?q=org%3Awikimedia+100-999&type=Code
We would also like to use it in Minerva in MobileWebMainMenuClickTracking

EventLogging is always involved.

Acceptance Criteria

To support this

  • We should add the get getEditCountBucket method to WikimediaEvents OR core OR EventLogging
  • Update Popups to use the new method
  • Update QuickSurveys to use the new method
  • Update Minerva's MobileWebMainMenuClickingTracking to use the new method.
  • Do not change the buckets. Changing the user buckets (or adding to them is out of scope for this task). As soon as this is defined in one place, we can consider that if needed in a follow up.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 21 2018, 7:05 PM
Jdlrobson renamed this task from Provide a reusable getEditCountBucket function to Provide a reusable getEditCountBucket function for analytics purposes.Nov 21 2018, 7:23 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson updated the task description. (Show Details)
Restricted Application added a project: Analytics. · View Herald TranscriptNov 21 2018, 7:23 PM
Jdlrobson triaged this task as Normal priority.Nov 22 2018, 9:19 PM

Change 475931 had a related patch set uploaded (by Pmiazga; owner: Pmiazga):
[mediawiki/extensions/EventLogging@master] Add reusable getEditCountBucket method

https://gerrit.wikimedia.org/r/475931

Jdlrobson updated the task description. (Show Details)Nov 27 2018, 5:38 PM
ovasileva set the point value for this task to 5.Nov 27 2018, 5:41 PM
fdans moved this task from Incoming to Radar on the Analytics board.Dec 3 2018, 5:59 PM
Jdlrobson changed the task status from Open to Stalled.Feb 27 2019, 5:38 PM
Jdlrobson added a subscriber: Nuria.

We synced on this today. This task is blocked on where the code should live. if we want to move it along we need to talk to @Nuria about her review on https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/EventLogging/+/475931/

Nuria added a comment.Feb 27 2019, 8:56 PM

Seems to me that a javascript package that bundles methods that are of interest would be a good idea. It should leave outside the infrastructure for instrumentation, BTW EL was refactored completely as of recent to make it super lightweight.

Change 475931 abandoned by Krinkle:
Add reusable getEditCountBucket method

https://gerrit.wikimedia.org/r/475931

What is the recommendation here? Should we decline this task and continue to roll our own (potentially introducing inconsistencies)? Or should we add this information to mw.user in core e.g. mw.user.getEditCountBucket()?

I am sorry I cannot advice of a better place for this code to go as I do not know the mw codebase well enough but adding instrumentation specific functions o an uber generic piece of javascript mostly concerned with generating random tokens for device sessions does not seem a good fit. It is probably advisable that instrumentation code that is shared among many audiences teams leaves in a package just created for this purpose and used by extensions such us the ones at the beginning of ticket. WikimediaEvents comes to mind but I defer to @Krinkle on whether that is a good idea at all.

Ping @jlinehan so he is aware of this discussion

@Krinkle I agree with you that there is no good place for that. Currently we do same buckets for:

I think that we had similar bucketing code somewhere else, but most probably it's already removed because I cannot find it. With AMC most probably we will use the same code once again (creating same 9 lines of code in another extension).

What I want to say, every time we come up with a schema that tracks edit count, we tend to use the same buckets every time.