Page MenuHomePhabricator

Add user groups to MobileWebUIActionsTracking
Closed, ResolvedPublic

Description

Per T310852, we want to know a user's user groups when they take actions logged by MobileWebUIActionsTracking. The primary use case is to know which users are clicking the 'switch to desktop' button from their mobile devices, so that we understand the situations in which users find the mobile website lacking in functionality.

In T310852 we added the 'switch to desktop' tracking, and discovered that user groups are not presently tracked. The scope of this ticket is to add that data to the tracking schema.

Event Timeline

At the onset we tried to add the userGroups to the instrument using

userGroups: mw.user.getGroups()

however

mw.user.getGroups()

returns a promise for backwards compatibility reasons – it used to call an make an XHR to the action API – but that promise is resolved with

mw.config.get( 'wgUserGroups' );

The current issue we are facing in the local environment is that

mw.config.get( 'wgUserGroups' );

is currently returning an empty array.

The current issue we are facing in the local environment is that
mw.config.get( 'wgUserGroups' );
is currently returning an empty array.

Sorry if this is a silly question but does the account you're testing with definitely have some user groups? I think by default a new account doesn't have any.

Greetings, @Samwalton9 I am a member of the Administrator and Users groups, I'm wondering if those groups are not considered by the routine.

Change 830488 had a related patch set uploaded (by Eigyan; author: Eigyan):

[mediawiki/extensions/WikimediaEvents@master] Add user groups attribute to mobileWebUI log event

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

Change 830664 had a related patch set uploaded (by Eigyan; author: Eigyan):

[schemas/event/secondary@master] Update mobilewebuiactionstracking with userGroups reference.

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

Change 830664 merged by jenkins-bot:

[schemas/event/secondary@master] Update mobilewebuiactionstracking with userGroups reference.

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

Change 830488 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@master] Add user groups attribute to mobileWebUI log event

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

Screenshot 2022-09-15 at 17.01.54.png (1×2 px, 222 KB)

Seeing events coming through with usergroups data!