Page MenuHomePhabricator

[M] Instrument audio and video playback in MediaSearch
Closed, ResolvedPublic

Description

We removed audio and video playback from the MediaSearch instrumentation ticket (T258183) since the a/v player work wasn't finished yet (T257637).

What still needs to be measured for this ticket:

  • when a user clicks listens to a piece of audio in quickview
  • when a user watches a video in quickview
  • when a user clicks through from quickview to the file page for an audio/video file

Here is the schema: Media Search measurement specification

Event Timeline

CBogen renamed this task from Instrument audio and video playback in MediaSearch to [M] Instrument audio and video playback in MediaSearch.Sep 23 2020, 4:56 PM

@egardner Can this be worked on now, or is the remaining work in T257637 (still open) expected to impact this?

@matthiasmullie This should be ready to go; I don't *think* any of the work to fix playback in various browsers should change how we instrument things.

The work on this task will be pretty similar to what was just done for https://phabricator.wikimedia.org/T263663. Two patches will be needed: one that updates the schema to support some new event types (should bump the version to 1.2.0 as well); the other should add the actual instrumentation code.

In terms of instrumenting, we have a player component that embeds the 3rd-party VideoJs library provided by TimedMediaHandler. We have been treating this component like a re-usable "base" component, meaning we're trying to keep it ignorant of the larger MediaSearch application. Given that, I would probably add logging by having the player emit a "play" event when playback is started (this might involve a custom listener for whatever VideoJS does here). That event would be handled at the parent (the Quickview component), which is where I would add the actual logging code: this.$log( { action: 'quickview_video_play' } ); or similar.

My only question about the work is: how important is it to differentiate between video and audio playback events in our data? Both file types use the same player component. If we just want to get a sense of how often video files vs audio files are played generally, we could have a single quickview_media_play action defined in the schema (instead of a separate one for video and audio), and then just include the current mediaType (which tab is active) when we log.

Change 663703 had a related patch set uploaded (by Eric Gardner; owner: Eric Gardner):
[schemas/event/secondary@master] Update schema to handle quickview playback events

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

Change 663707 had a related patch set uploaded (by Eric Gardner; owner: Eric Gardner):
[mediawiki/extensions/WikibaseMediaInfo@master] Instrument quickview play events

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

Both the schema update patch and the instrumentation patch are now ready for review here.

Change 663703 merged by Mholloway:
[schemas/event/secondary@master] Update schema to handle quickview playback events

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

Change 663707 merged by jenkins-bot:
[mediawiki/extensions/WikibaseMediaInfo@master] Instrument quickview play events

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

Etonkovidova added a subscriber: Etonkovidova.

Checked on commons wmf.35 - no validation errors; the detailed events info are below,

Just a note - action: "quickview_hide" doesn't have reference to the media type.

Audio

(1) clicking on a audio link

{action: "result_click", search_media_type: "audio", search_result_page_id: 79161523, search_result_position: 1, search_result_has_quickview: true, …}
$schema: "/analytics/mediawiki/mediasearch_interaction/1.3.0"
action: "result_click"
dt: "2021-03-18T01:31:08.720Z"
language_code: "en"
meta: {stream: "mediawiki.mediasearch_interaction", domain: "commons.wikimedia.org"}
search_media_type: "audio"
search_result_has_quickview: true
search_result_page_id: 79161523
search_result_position: 1
ui_mw_skin: "vector"
web_pageview_id: "be950910b91931ac5903"
__proto__: Object

(2) clicking to play (pausing and click to play do not add any events)

{action: "quickview_media_play", search_media_type: "audio", $schema: "/analytics/mediawiki/mediasearch_interaction/1.3.0", web_pageview_id: "be950910b91931ac5903", language_code: "en", …}
$schema: "/analytics/mediawiki/mediasearch_interaction/1.3.0"
action: "quickview_media_play"
dt: "2021-03-18T01:31:22.420Z"
language_code: "en"
meta: {stream: "mediawiki.mediasearch_interaction", domain: "commons.wikimedia.org"}
search_media_type: "audio"
ui_mw_skin: "vector"
web_pageview_id: "be950910b91931ac5903"
__proto__: Object

(3) click on x to close QuickView

{action: "quickview_hide", $schema: "/analytics/mediawiki/mediasearch_interaction/1.3.0", web_pageview_id: "be950910b91931ac5903", language_code: "en", ui_mw_skin: "vector", …}
$schema: "/analytics/mediawiki/mediasearch_interaction/1.3.0"
action: "quickview_hide"
dt: "2021-03-18T01:32:52.390Z"
language_code: "en"
meta: {stream: "mediawiki.mediasearch_interaction", domain: "commons.wikimedia.org"}
ui_mw_skin: "vector"
web_pageview_id: "be950910b91931ac5903"
__proto__: Object
Video

(1) clicking on a video thumbnail

{action: "result_click", search_media_type: "video", search_result_page_id: 3627042, search_result_position: 13, search_result_has_quickview: true, …}
$schema: "/analytics/mediawiki/mediasearch_interaction/1.3.0"
action: "result_click"
dt: "2021-03-18T01:34:07.200Z"
language_code: "en"
meta: {stream: "mediawiki.mediasearch_interaction", domain: "commons.wikimedia.org"}
search_media_type: "video"
search_result_has_quickview: true
search_result_page_id: 3627042
search_result_position: 13
ui_mw_skin: "vector"
web_pageview_id: "be950910b91931ac5903"
__proto__: Object

(2) clicking to play (pausing and click to play do not add any events)

{action: "quickview_media_play", search_media_type: "video", $schema: "/analytics/mediawiki/mediasearch_interaction/1.3.0", web_pageview_id: "be950910b91931ac5903", language_code: "en", …}
$schema: "/analytics/mediawiki/mediasearch_interaction/1.3.0"
action: "quickview_media_play"
dt: "2021-03-18T01:34:14.425Z"
language_code: "en"
meta: {stream: "mediawiki.mediasearch_interaction", domain: "commons.wikimedia.org"}
search_media_type: "video"
ui_mw_skin: "vector"
web_pageview_id: "be950910b91931ac5903"
__proto__: Object

(3) click on x to close QuickView

{action: "quickview_hide", $schema: "/analytics/mediawiki/mediasearch_interaction/1.3.0", web_pageview_id: "be950910b91931ac5903", language_code: "en", ui_mw_skin: "vector", …}
$schema: "/analytics/mediawiki/mediasearch_interaction/1.3.0"
action: "quickview_hide"
dt: "2021-03-18T01:34:24.485Z"
language_code: "en"
meta: {stream: "mediawiki.mediasearch_interaction", domain: "commons.wikimedia.org"}
ui_mw_skin: "vector"
web_pageview_id: "be950910b91931ac5903"
__proto__: Object