I did a test on a subset of the data and found that all the appInstallID in MobileWikiAppDailyStats are not in webrequest, and all the appInstallID in webrequest are not in MobileWikiAppDailyStats (See https://phabricator.wikimedia.org/P6819 for the queries. Confirmed in one example: P6819#38753 ).
Later, we discover that the reason for this issue is we generate different appInstallID for different funnels. Specifically, WMFDailyStatsLoggingFunnel, ReadingActionFunnel and WMFShareFunnel (not sure if there are other funnels) generate different appInstallID. Among them, WMFShareFunnel and WMFDailyStatsLoggingFunnel only send the ID to their corresponding event logging schemas, while ReadingActionFunnel send ID to BOTH event logging schema AND X-Analytics header along with api calls to retrieve feed, articles, etc.
Steps to reproduce
- Set a breakpoint here https://github.com/wikimedia/wikipedia-ios/blob/e444abd854fc79af9caf2440439c40d70b65cb75/Wikipedia/Code/EventLogger.m#L39
- Clean install, opt in to send reports during onboarding :D
- When breakpoint is triggered for the first time, po event and note the ID (that's the one generated by WMFDailyStatsLoggingFunnel)
- Continue execution
- Save one of the articles in the feed
- When breakpoint is triggered, po event and note the ID (that's the one generated by ReadingActionFunnel)
- Continue execution
- Open that article and tap share on the article toolbar
- When breakpoint is triggered, po event and note the ID (that's a different ID generated by WMFShareFunnel)
It looks like WMFSuggestedPagesFunnel, WMFSearchFunnel and WMFHamburgerMenuFunnelgenerate aren't even used anywhere so it's safe to disregard those.
Expected Results
We want to use the same appInstallID across all schemas and X-Analytics header. This ID should be the same after user update the app. BUT delete/reinstall or opt-out/in should delete the ID, and create a new one.
See also T189359: [Bug] WMFDailyStatsLoggingFunnel doesn't send event on the day users opt-in from setting
