As part of the instrumentation for the Reading Lists experiment T397532, we want to log the** total number of articles that a user saves** throughout the experiment.
After discussing this metrics with the Reader Experience team engineers & product analytics ([[ https://docs.google.com/document/d/1U74OY3COTXFo4ozEs4nkFW6d5vpGEEAuP1kus_TH9JU/edit?tab=t.0 | meeting notes ]]), we decided the most performant and stable way of logging this metrics would be by sending an eventLogging event whenever an API add/delete event occurs.
We discussed different options of how to send this data. Client-side, in browser, we don't have access to the users total number of saved articles, so instead, we opted to send this event from PHP in the Reading List extension. [[ https://wikitech.wikimedia.org/wiki/Experimentation_Lab/PHP_API | Experiment Lab PHP API ]].
=== User story
//As a product team, we want to know how many articles users save during this experiment.//
---
== Requirements
{F65790231}
Whenever someone clicks the bookmark icon, we want to log an event containing the total number of pages they have saved.
User flow
1. A user is bucketed into the experiment
2. They save or remove an article
3. That user behaviour triggers an API call.
4. When the API is called in the backend, we log an eventLogging event that contains the total number of saved articles.
[] **Article save or remove event (backend)**
```
action: TBD
action_subtype: save_article_to_reading_list / remove_article_from_reading_list
action_source: reading_list_api
action_context: {article_count: <INT>}
```
- [[ https://docs.google.com/presentation/d/18G3jExkwKo9iNI35KrppcDVoAz9NjQDb4J0463RisdA/edit?slide=id.g37524e7e1e2_0_0#slide=id.g37524e7e1e2_0_0 | Instrumentation workflow ]]
- [[ https://docs.google.com/document/d/1gsBpCQXFz3aCgidMBYkzijtnaaHq5b8yf-zRENXmIfc/edit?tab=t.0 | Measurement plan ]]
- [[ https://docs.google.com/spreadsheets/d/1zbz52jUbSGteSUvNmZBlKaGXWJUf9pRnbARz1wtKP9M/edit?gid=0#gid=0 | Instrumentation spec ]]
=== Acceptance criteria
Since this event will be sent from PHP, it will not be visible in the browser console. Instead, we have to inspect the eventlogging end-point to see if the event was sent.
- []
=== BDD
- //For QA engineer to fill out.//
=== Test Steps
- //For QA engineer to fill out.//
//This task was created by Version 1.0.0 of the Reader Experience team task template using [[ https://phabulous.toolforge.org/ | phabulous ]].//