Page MenuHomePhabricator

Update definition of page view and implementation for mobile apps {hawk} [8 pts]
Closed, ResolvedPublic

Description

This discussion is about needed updates of the definition and Analytics implementation for mobile apps page view metrics.

Background / Changes

As you probably remember, the Android app splits a page view into two requests: one for the lead section and metadata, plus another one for the remainder.

The mobile apps are going to change the way they load pages in two different ways:

  1. We'll add a link preview when someone clicks on a link from a page.
  2. We're planning on switching over the using RESTBase for loading pages and also the link preview (initially just the Android beta, ater more)

This will have implications for the pageviews definition and how we count user engagement.

The big question is

Should we count link previews as a page view since it's an indication of user engagement? Or should there be a separate metric for link previews?

Counting page views

IIRC we currently count action=mobileview&sections=0 query parameters of api.php as a page view. When we publish link previews for all Android app users then we would either want to count also the calls to action=query&prop=extracts as a page view or add them to another metric.

Once the apps use RESTBase the HTTPS requests will be very different:

  • Page view: Instead of action=mobileview&sections=0 the app would call the RESTBase endpoint for lead request[1] instead of the PHP API mentioned above. Then it would call [2].
  • Link preview: Instead of action=query&prop=extracts it would call the lead request[1], too, since there is a lot of overlap. At least that our current plan. The advantage of that is that the client doesn't need to execute the lead request a second time if the user clicks on the link preview (-- either through caching or app logic.)

So, in the RESTBase case we either want to count the mobile-html-sections-lead requests or the mobile-html-sections-remaining requests depending on what our definition for page views actually is. We could also add a query parameter or extra HTTP header to one of the mobile-html-sections-lead requests if we need to distinguish between previews and page views.

Both the current PHP API and the RESTBase based metrics would need to be compatible and be collected in parallel since we cannot control when users update their apps.

[1] https://en.wikipedia.org/api/rest_v1/page/mobile-html-sections-lead/Dilbert
[2] https://en.wikipedia.org/api/rest_v1/page/mobile-html-sections-remaining/Dilbert
[3] https://www.mediawiki.org/wiki/Wikimedia_Apps/Team/RESTBase_services_for_apps

Event Timeline

bearND created this task.Aug 17 2015, 9:59 PM
bearND updated the task description. (Show Details)
bearND raised the priority of this task from to Needs Triage.
bearND added subscribers: bearND, dr0ptp4kt, Dbrant.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 17 2015, 9:59 PM
dr0ptp4kt set Security to None.
dr0ptp4kt moved this task from Backlog to Waiting on the Reading-Admin board.
kevinator triaged this task as High priority.Aug 20 2015, 5:20 PM
kevinator moved this task from Incoming to Prioritized on the Analytics-Backlog board.
kevinator renamed this task from Update definition of page view and implementation for mobile apps to Update definition of page view and implementation for mobile apps {hawk}.

I've asked for the meeting to be rescheduled.

JAllemandou renamed this task from Update definition of page view and implementation for mobile apps {hawk} to Update definition of page view and implementation for mobile apps {hawk} [8 pts].Aug 24 2015, 4:14 PM
JAllemandou moved this task from Prioritized to Tasked on the Analytics-Backlog board.

Change 234937 had a related patch set uploaded (by BearND):
Add isAppPreview to pageview definition

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

Change 234937 abandoned by BearND:
Add isAppPreview to pageview definition

Reason:
will resubmit

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

Change 234938 had a related patch set uploaded (by BearND):
Add isAppPreview to pageview definition

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

Milimetric claimed this task.
Nuria added a subscriber: Nuria.Sep 2 2015, 3:35 PM
Milimetric reassigned this task from Milimetric to Nuria.Sep 3 2015, 4:42 PM
Nuria added a comment.Sep 3 2015, 9:49 PM

Apps need to tag on X-Analytics header whether a request is a pageview or a preview (regardless of the shape of url on the request) . On our end we can count pageviews/previews in a way that is not tied to the implementation of apps requests.

We can use for this tagging X-Analytics header: See https://phabricator.wikimedia.org/T110702

@dr0ptp4kt @Nuria I'll be ooo tomorrow already.

Just reiterating what I said in T110702#1598445:

The discussion on Gerrit has introduced some new options.
We want to be more explicit about page preview events:
The apps can add an X-Analytics header to the request with a specific value, e.g. "preview".
Eventually, this should use EventLogging instead since for the iOS case (and probably Android later, too) we might prefetch several preview entries without a user necessarily looking at them all. I'm going to let @Dbrant and @Fjalapeno continue this discussion and any related patches.

@Milimetric proposed X-Analytics: preview=1 which is fine with me, whatever our POs like. It concerns them more.

I don't mind if someone amends the patch I started or abandons it and creates a new one if you want to measure the page preview impressions via the X-Analytics request header.

Nuria added a comment.Sep 4 2015, 2:24 PM

Ok, since @bearND is OOT I will take care of code changes cc @dr0ptp4kt

Change 234938 abandoned by Nuria:
Add isAppPreview to pageview definition

Reason:
Changes WIP by analytics here: https://gerrit.wikimedia.org/r/#/c/237274

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

Change 237419 had a related patch set uploaded (by Joal):
Bump core and hive jar versions

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

Change 237419 merged by Joal:
Bump core and hive jar versions

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

kevinator closed this task as Resolved.Sep 18 2015, 11:09 PM