Event Platform Client Libraries
We are making changes to the client libraries we use to send analytics events.
The decision to evolve our client libraries arose from a combination of factors.
- T215435: Conduct Audiences teams instrumentation survey suggested that these libraries tend to be a source of frustration for product owners, engineers, and analysts.
- T185233: Modern Event Platform provided a strong new set of backend capabilities for us to take advantage of, especially T205319: Modern Event Platform: Stream Configuration and T201063: Modern Event Platform: Schema Repostories.
- The results of a stakeholder meeting (slides) in which this project was proposed.
Evolving our event platform clients (sometimes generally referred to as "EventLogging") in their current state presents a number of challenges. Currently, MediaWiki JavaScript, the Android Wikipedia app, and the iOS Wikipedia app each has some kind of library for sending events to the Event Platform. The decision was made to eliminate this heterogeneity as much as possible, by developing a common specification that can be followed by all clients. This would also be beneficial for cross-platform analysis, maintainability, porting, testing, and documentation.
Status
- Q1: Use the capabilities of the MEP, along with results from the comprehensive user survey, to define a set of requirements.
- Q1: Work backwards from the requirements to a common specification that can be followed by all "event platform clients".
- Q1: Implement a prototype of the common specification on each of the three major platforms.
- Q2: Work together with analytics engineering to finish developing required MEP components
- Q2: Work together with product owners and specialists to review, revise, and productionize the prototypes
- Q2: Complete documentation of specification and offer for wide review
Platform targets
- T228179: Event Platform Client — Android
- T228180: MEP Client iOS (MVP)
- T228181: MEP Client MediaWiki [task obsolete]
Code units
Output controller - controls when and how events are transmitted over HTTP
Association controller - provides, and stores various ID values that associate events at query-time
Sampling controller - determines whether a stream is in- or out-sample on the client
Main - the public interfaces to add stream configuration and log events
Debug - tools for developers to inspect behavior during testing
Integration - abstraction layer for external functions, mostly used for testing
More information will be added to this ticket soon as we document the specification.
Just, where's the code?
This code is currently undergoing CR, has not yet been moved into Gerrit, and is subject to substantial change.
Temporary repository: https://github.com/linehan/wmf-epc
Existing client libraries (for reference)
- Browsers:
- Client library core
- Instrumentation
- Some called directly using mw.track("event.<schema>", data)
- Complex ones found in WikimediaEvents extension:
- Android:
- Client library core
- https://github.com/wikimedia/apps-android-wikipedia/blob/master/app/src/main/java/org/wikipedia/analytics/EventLoggingService.java
- https://github.com/wikimedia/apps-android-wikipedia/blob/master/app/src/main/java/org/wikipedia/analytics/EventLoggingEvent.java
- https://github.com/wikimedia/apps-android-wikipedia/blob/master/app/src/main/java/org/wikipedia/analytics/Funnel.java
- https://github.com/wikimedia/apps-android-wikipedia/blob/master/app/src/main/java/org/wikipedia/analytics/TimedFunnel.java
- Instrumentation
- Client library core
- iOS:
- Client library core
- Instrumentation
- https://github.com/wikimedia/wikipedia-ios/blob/develop/Wikipedia/Code/EditFunnel.swift and many other such Funnels.