Page MenuHomePhabricator

Add `X-Analytics: pageview=1` header to page view requests
Closed, ResolvedPublic

Description

The analytics code that counts page views for the apps relies on checking for specific endpoints, so it stopped counting when the apps switched to mobile-html. Setting X-Analytics: pageview=1 for requests that are made when the user views a page will ensure page views are counted even if the API is switched again.

Event Timeline

@Charlotte @JMinor @SNowick_WMF the Android app release that added the X-Analytics: pageview=1 header added it to all mobile-html requests, not just when the page is loaded into an article view. So when a user syncs reading lists, or saves an article for offline, the header is included. This is how pageviews were counted previously. I assumed that in adding the header, we would limit it to requests made by the article view when the user views a page. That was the intent of this ticket, apologies if that wasn't clear. The iOS version we have staged for release with this fix only adds it when the user loads the page in an article view, not with offline requests. We should resolve this discrepancy before the iOS app goes out.

Given that we counted save for offline downloads in previous request-based pageview definitions, should we keep that behavior until we switch to an event based system? Or should we try for the intermediate fix of only adding the header to requests made from the article view?

Keeping the old definition means we'd have to update the iOS app before it goes out. Trying for the intermediate fix means we'd have to update the Android app, and deal with the additional inconsistency in the data.

Given that we counted save for offline downloads in previous request-based pageview definitions

I do not think an explicit decision was ever made on this regard, offline functionality was added to the apps and the code of pageview definition was not updated to account for that, thus, by default counting offline downloads as pageviews.

Charlotte reopened this task as Open.

(Sorry kids - closed out the wrong ticket.)

JMinor claimed this task.

This is now out. Given the rushed iOS 14 update turn over to the new version might be a bit slower than usual, but the change is out and this header should be sent as intended now.