Clicks to items in the main menu are logged via the [[https://meta.wikimedia.org/wiki/Schema:MobileWebMainMenuClickTracking|MobileWebMainMenuClickTracking schema]] for 50% of all session IDs. For AMC users we want to log all clicks and we need a way to distinguish these users from normal users.
= Acceptance criteria
[x] Update the schema to have an AMC flag
[] Update the schema revision number in MobileFrontend and move to Minerva codebase
[] Sampling rate should be 100% if the user is AMC, otherwise use the configurable sampling rate
[] Log whether the user is in AMC mode using the new schema revision ID
= Open questions
Do we want to use the existing "mode" field in https://meta.wikimedia.org/wiki/Schema:MobileWebMainMenuClickTracking to track "amc" e.g. "amc+stable", "amc+beta" or create a dedicated field with boolean? Cf. notes at T212961
= Sign off steps
[] Document the oversampling behaviour for AMC on the schema's talk page so Tilman can understand it
= QA steps
This can be tested on the beta cluster using an incognito window.
50% of clicks in the main menu are tracked via the MobileWebMainMenuClickTracking schema. Please verify that you can see every scenario
== Anons
=== Scenario 1a (50% chance)
[] Open an incognito window with https://en.m.wikipedia.beta.wmflabs.org/wiki/Spain
[] Open developer tools and select network tab. Make sure "preserve log" is ticked and type "MobileWebMainMenuClickTracking" in the filter box
[] Click the hamburger menu
[] Open a link in a new window
[] Verify that an event shows up in the list of network requests
[] Inspect the request's "Query string parameters" and verify that "amc":false is in it
=== Scenario 1b (50% chance)
[] Open an incognito window with https://en.m.wikipedia.beta.wmflabs.org/wiki/Spain
[] Open developer tools and select network tab. Make sure "preserve log" is ticked and type "MobileWebMainMenuClickTracking" in the filter box
[] Click the hamburger menu
[] Open a link in a new window
[] Verify that no event shows up in the list of network requests
== AMC user
=== Scenario 2a (100% chance)
[] Open an incognito window with https://en.m.wikipedia.beta.wmflabs.org/wiki/Spain
[] Login as a user with AMC mode enabled
[] Open developer tools and select network tab. Make sure "preserve log" is ticked and type "MobileWebMainMenuClickTracking" in the filter box
[] Click the hamburger menu
[] Open a link in a new window
[] Inspect the request's "Query string parameters" and verify that "amc":true is in it
== non-AMC user
=== Scenario 3a (50% chance)
[] Open an incognito window with https://en.m.wikipedia.beta.wmflabs.org/wiki/Spain
[] Login as a user with AMC mode DISABLED
[] Open developer tools and select network tab. Make sure "preserve log" is ticked and type "MobileWebMainMenuClickTracking" in the filter box
[] Click the hamburger menu
[] Open a link in a new window
[] Verify that an event shows up in the list of network requests
[] Inspect the request's "Query string parameters" and verify that "amc":false is in it
=== Scenario 3b (50% chance)
[] Open an incognito window with https://en.m.wikipedia.beta.wmflabs.org/wiki/Spain
[] Login as a user with AMC mode DISABLED
[] Open developer tools and select network tab. Make sure "preserve log" is ticked and type "MobileWebMainMenuClickTracking" in the filter box
[] Click the hamburger menu
[] Open a link in a new window
[] Verify that no event shows up in the list of network requests
== QA Results
| **AC** | **Status** | **Details** |
| 1a | ✅ | T218627#5139052 |
| 1b | ✅ | T218627#5139052 |
| 2a | ✅ | T218627#5139052 |
| 3a | ✅ | T218627#5139052 |
| 3b | ✅ | T218627#5139052 |