Page MenuHomePhabricator

API pageview counts for 'Mobile app' are incorrect since switch to mobile-html
Closed, ResolvedPublic

Description

The latest versions of both Android Build 2.7.50318 (prod 2020-05-18) and iOS Build 6.6.1 (prod 2020-06-05) mobile apps are using mobile-html to serve content and it appears that the backend has not been adjusted to register pageview counts accordingly. We need to modify the pageview definition to catch the mobile-html views.

We are seeing a significant drop in pageviews filtered by 'mobile app' when querying the /metrics endpoint of the REST API and through Pageviews Analysis on Toolforge. Our Pageviews Superset shows the drop ~ 2020-05-18 when filtered by 'mobile app' as well.

Want to be sure our analytics are setup correctly and that Analytics Engineering is aware of the change. The definition will be updated on the apps, but the webrequests from 2020-05-18 will need to be re-tagged.

@mpopov: so the good news is that webrequests (the source data from which pageview counts we use everywhere are derived) is retained for 90 days, so we can still work with AE to modify the pageview definition (since we can't modify the logged requests) and re-count the pageviews using the updated definition so it catches those mobile-html requests. the bad news is this is extra stress on an already underresourced team, so we'll have to be very nice and understanding

The mobile apps will also need to make changes on their end: T256507 T257389

Other helpful information:
@JoeWalsh: Is the existing PageView counting based on requests to /page/mobile-sections-lead/ for Android and the MobileView API for iOS?
@mpopov : app pageviews are counted by looking at webrequests to the API, see PageviewDefinition.java#L111-L175 and it's looking for /page/mobile-sections/ in the absence of pageview=1 in the X-Analytics header. So as long as the apps' UserAgent validates and the apps set pageview=1 in the mobile-html requests (which are made to the MW API, right?) then the app pageview definition does not need to be modified, although it would be a good idea to make a note of the new endpoint
@JoeWalsh: It looks like we don’t set pageview=1 in either app, so it was probably caught by checking for restAppPageURIPath or iosAppPageURIQuery so there’s now an additional restAppPageURIPath that is /page/mobile-html and it’s used by both iOS and Android (previously only Android used /page/mobile-sections )

Related Objects

Event Timeline

SNowick_WMF renamed this task from API pageview counts for 'Mobile app' are off since switch to mobile-html to API pageview counts for 'Mobile app' are incorrect since switch to mobile-html .Jun 26 2020, 9:16 PM
kzimmerman added a project: Analytics.

so the good news is that webrequests (the source data from which pageview counts we use everywhere are derived) is retained for 90 days, so we can still work with AE to modify the pageview definition (since we can't modify the logged requests) and re-count the pageviews using the updated definition so it catches those mobile-html requests.

The caveat here is that this is only possible if we have computing resources to do so while continuing computing the regular pageview stream, that implies doubling our computing capacity which I am not sure is possible.

The way to avoid this happening in the future is to move to event-based pageviews (MEP can help) for us, which puts 100% of the control in defining and sending pageview events in the hands of mobile teams.

@JoeWalsh let's talk at your covenience about a path to migrate pageviews for the app to be event based

@Nuria sounds good, I'd happy to talk about that. I set up a meeting to discuss.

LGoto lowered the priority of this task from High to Medium.Sep 21 2020, 4:36 PM