Page MenuHomePhabricator

Web UI click tracking doesnt distinguish temporary users from logged in users
Closed, ResolvedPublic3 Estimated Story Points

Description

NOTE: if the new event platform schemas have temporary account support by default apologies in advance for this ticket.

Background

The web UI click tracking schema will not cause any erroneous data when temporary accounts are enabled but as currently written it will not allow opportunities for analysing click tracking behaviour in temp accounts.

User story

As a PM I want to analyse questions such as "how many temporary users click the logout button"

Requirement

Add a temporary account identifier field (isTemp) to the web UI click tracking schema to enable analysis of click behavior among temporary account users. Update WikimediaEvents to the new schema version, ensuring all relevant events now include the isTemp field.

BDD

Feature: Track click behavior for temporary accounts with isTemp field

  Scenario: Include isTemp field in click tracking schema for temporary accounts
    Given a user with a temporary account interacts with the UI
    When the click tracking event fires in the web_ui_actions schema
    Then the event should include the isTemp field
    And the isTemp field should indicate that the user is a temporary account

Test Steps

Test Case 1: Verify isTemp Field in Web UI Click Tracking for Temporary Accounts

  1. Log in as a Temporary Account user.
  2. Perform any UI interaction (e.g., click the logout button).
  3. Open Chrome DevTools and go to the Network tab.
  4. Filter by events, and look for the schema web_ui_actions.
  5. AC1: Confirm that the isTemp field appears in the event data, showing that it identifies the user as a temporary account.

Design

  • Add mockups and design requirements

Acceptance criteria

  • Add acceptance criteria

Communication criteria - does this need an announcement or discussion?

  • Add communication criteria

Rollback plan

  • What is the rollback plan in production for this task if something goes wrong?

This task was created by Version 1.2.0 of the Web team task template using phabulous

QA Results - Beta

ACStatusDetails
1T377590#10302496

QA Results - Prod

ACStatusDetails
1T377590#10315123

Details

Related Changes in Gerrit:
Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
Adds temp user field in schemarepos/data-engineering/schemas-event-secondary!20ksarabiaT377590-update-schema-tempmaster
Customize query in GitLab

Event Timeline

@ovasileva this came up in https://phabricator.wikimedia.org/T375712#10240244 - basically @RHo was asking if we could detect clicks to "Exit session" from users. We can but we can't distinguish between a logged in user logging out and a temporary user. Not sure how important this is and whether it should be a considered a blocker for filing a ticket (please also see my concern on T374942#10242904) - we potentially might need tickets for our other schemas if there are other product needs.

@ovasileva this came up in https://phabricator.wikimedia.org/T375712#10240244 - basically @RHo was asking if we could detect clicks to "Exit session" from users. We can but we can't distinguish between a logged in user logging out and a temporary user. Not sure how important this is and whether it should be a considered a blocker for filing a ticket (please also see my concern on T374942#10242904) - we potentially might need tickets for our other schemas if there are other product needs.

We don't need to, right? The "Exit session" button is only visible for temp accounts. So all that would theoretically be needed is tracking a click to the button?

We would need events for:

  • Log-in
  • Exit session

This is not quite right. The issue isnt about adding events for clicks it is about distinguishing temporary accounts from logged in accounts.

The elements are tracked but events will appear with isAnon=false. While this allows us to identify the log in link (as no login link is shown to logged in users) it doesnt alllow us to distinguish "exit session" - as an event for that click will look identical to an event for "logout" for a logged in user.

If we only care about that link, yes we should change its event but that would likely need some other changes - they share code for good reasons. I wouldnt recommend this path.

However this goes deeper than those links - all events for temporary users will look like events for a logged in user so if you want information such as click through rate for temporary account or to compare clicks to say the random button (from s logged in vs temporary account user) you cant get that without an additional schema field.

We would need events for:

  • Log-in
  • Exit session

This is not quite right. The issue isnt about adding events for clicks it is about distinguishing temporary accounts from logged in accounts.

The elements are tracked but events will appear with isAnon=false. While this allows us to identify the log in link (as no login link is shown to logged in users) it doesnt alllow us to distinguish "exit session" - as an event for that click will look identical to an event for "logout" for a logged in user.

If we only care about that link, yes we should change its event but that would likely need some other changes - they share code for good reasons. I wouldnt recommend this path.

However this goes deeper than those links - all events for temporary users will look like events for a logged in user so if you want information such as click through rate for temporary account or to compare clicks to say the random button (from s logged in vs temporary account user) you cant get that without an additional schema field.

@ovasileva and I spoke earlier today about this and we both wonder if it is possible to filter to temporary users only without additional scheme by using the unique username pattern for temp accounts -- ie. is it possible to show the number of "logout" clicks from logged in user that have a username starting with ~20?

ie. is it possible to show the number of "logout" clicks from logged in user that have a username starting with ~20?

No. Not with the existing schema. We do not log username for privacy reasons.

ovasileva set the point value for this task to 3.

Change #1084228 had a related patch set uploaded (by Kimberly Sarabia; author: Kimberly Sarabia):

[mediawiki/extensions/WikimediaEvents@master] Adds new field

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

Change #1084228 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@master] Adds new field

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

The fix is not working. Taking another look.

Change #1087211 had a related patch set uploaded (by Kimberly Sarabia; author: Kimberly Sarabia):

[mediawiki/extensions/WikimediaEvents@master] Adds missing object key

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

Change #1087211 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@master] Adds missing object key

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

Test Result - Beta

Status: ✅ PASS
Environment: Beta
OS: macOS
Browser: Chrome
Device: MS
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Verify isTemp Field in Web UI Click Tracking for Temporary Accounts

  1. Log in as a Temporary Account user.
  2. Perform any UI interaction (e.g., click the logout button).
  3. Open Chrome DevTools and go to the Network tab.
  4. Filter by events and locate the schema web_ui_actions.
  5. ✅ AC1: Confirm that the isTemp field appears in the event data, correctly identifying the user as a temporary account.

screenshot 15.png (355×735 px, 74 KB)

Test Result - Prod

Status: ✅ PASS
Environment: testwiki
OS: macOS
Browser: Chrome
Device: MS
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Verify isTemp Field in Web UI Click Tracking for Temporary Accounts

  1. Log in as a Temporary Account user.
  2. Perform any UI interaction (e.g., click the logout button).
  3. Open Chrome DevTools and go to the Network tab.
  4. Filter by events and locate the schema web_ui_actions.
  5. ✅ AC1: Confirm that the isTemp field appears in the event data, correctly identifying the user as a temporary account.

screenshot 24.png (614×961 px, 114 KB)

@RHo, @kostajh - this is now ready from our side so I'll go ahead and resolve the ticket. Let us know if there's any additional questions or follow-ups needed!