Page MenuHomePhabricator

StoryViewer instrumentation
Closed, ResolvedPublic

Description

Schema: https://gerrit.wikimedia.org/r/c/schemas/event/secondary/+/773382/2/jsonschema/analytics/mediawiki/wikistories_consumption_event/1.0.0.json (there's an example of an event at the bottom of the schema)
Instrumentation plan: https://docs.google.com/document/d/10saUCO6lIl8CsSJ4wOOuEfDlyagdP3DMXFP9q4ByMP8/edit#heading=h.187jptb4zpka

Events to log:

  • story_impression
  • story_view

Fields to log for each event is described in the plan and the schema.

Example event logging from javascript

mw.eventLog.submit( 'analytics/mediawiki/wikistories_consumption_event', {
    "$schema": "/analytics/mediawiki/wikistories_consumption_event/1.0.0",
    "meta": {
        "stream": "mediawiki.wikistories_consumption_event",
        "domain": "id.m.wikipedia.org",
        "dt": "2022-11-11T00:40:00.649Z"
    },
    "event_type": "story_view",
    "activity_session_id": "46e8e1f264c66cbf13fa",
    "pageview_id": "0578dbb2215dc583d147",
    "access_method": "mobile web",
    "page_title": "Istanbul",
    "page_story_count": 3,
    "page_visible_time": 84124,
    "story_open_time": 29018,
    "referrer_type": "internal",
    "story_title": "Kucing_Istanbul",
    "story_frame_count": 6,
    "story_frames_viewed": 6,
    "story_completed": true,
    "next_story_opened": false,
    "experiment_group": "wikistories",
    "experiment_entry_date": "2022-10-27",
    "session_is_first_of_day": true,
    "session_days": [ 1, 4, 5, 9, 16 ]
} );

Event Timeline

SBisson triaged this task as High priority.Apr 13 2022, 3:26 PM
SBisson updated the task description. (Show Details)
SBisson moved this task from Definition to Ready for Dev on the Inuka-Team (Kanban) board.

Change 784691 had a related patch set uploaded (by Sbisson; author: Sbisson):

[mediawiki/extensions/Wikistories@master] Log consumption events

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

Change 784691 merged by jenkins-bot:

[mediawiki/extensions/Wikistories@master] Log consumption events

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

Testing:
I will need some help to know how to view logs.

Testing

Hi @eamedina
Here is an example of the logs when viewing a story:

event: {

  "$schema": "/analytics/mediawiki/wikistories_consumption_event/1.0.0",
  "meta": {
    "stream": "analytics/mediawiki/wikistories_consumption_event",
    "domain": "localhost",
    "dt": "2022-05-13T22:58:47.599Z",
    "id": "f1db9ce3-0744-4b56-8fc1-3fd5ed8a8562",
    "request_id": "3fe0b030-d310-11ec-8833-0b77b8c8e58c"
  },
  "activity_session_id": "85ea4027dcf22786c1d1",
  "pageview_id": "2ef12c30e7385ea276d8",
  "access_method": "mobile web",
  "page_title": "Coconuts",
  "event_type": "story_view",
  "story_title": "Whites",
  "story_frame_count": 3,
  "story_frames_viewed": 3,
  "story_completed": true,
  "story_open_time": 15007,
  "page_story_count": 2,
  "dt": "2022-05-13T22:58:47.599Z"
}

Comparing with the example given in the ticket description, I notice some fields relating to session and experiment are not present. Is this a problem?

@EUdoh-WMF that's fine, those fields missing are expected. The missing fields will be included later after initial release, according to the Wikistories evaluation plan. Thanks for checking!