Events fired via EventLogging inspects the DNT header and does not send events when it is present.
For the VirtualPageView schema, in order to have consistency with how we track page views we will need to send the event regardless of whether that header is present.
Per Sam's suggestion this should be done solely in the Popups extension, not EventLogging.
Further background:
https://phabricator.wikimedia.org/T187277#4052896
Acceptance criteria
- Readers Web will opt for #3: we'll use parts of the core EventLogging client-side API in order to construct the correct URL to request and make the request using sendBeacon inside of the Page Previews codebase, e.g.
const eventData = { // ... }; const payload = mw.eventLog.prepare( 'VirtualPageview', eventData); const url = mw.eventLog.makeBeaconUrl( payload ); navigator.sendBeacon( url );
Testing criteria
Test on the beta cluster. Hover over a link and hold the mouse there for at least a second. An EventLogging event should fire for all requests (in incognito window and new window)
Verify that events are sent to the VirtualPageView schema even if Chrome is configured to send the do not track header.
Verify the same for Firefox.
Signoff criteria
- Ensure acceptance criteria is implemented