Issues in LanguageSettings and LanguageSearching funnels
Open, Needs TriagePublicbug


Problem 1

First, there's something wrong with the searched field as it is true in every case:

  IF(event_searched = 0, 'no', 'yes') AS searched,
  COUNT(DISTINCT event_app_install_id, event_session_token) AS sessions
FROM MobileWikiAppLanguageSettings_18113720;

And unfortunately I missed it during dev/QA for T190931. Looking at the debug info in Logcat, event_searched is indeed set to true even when not searching for a language.

Problem 2

If we try to join events in LanguageSettings with events in LanguageSearching using the app install ID and session tokens as keys, we should get something, but:

FROM MobileWikiAppLanguageSettings_18113720 AS settings
INNER JOIN MobileWikiAppLanguageSearching_18113721 AS searches ON (
  settings.event_app_install_id = searches.event_app_install_id AND
  settings.event_session_token = searches.event_session_token

unfortunately returns nothing :( In dev logs, session_token field works as expected, with the same token in LanguageSearching events as in LanguageSettings events.

This makes me suspect that there's a sampling issue that we couldn't see in development because sampling is turned off, so in production there's something funky going on. Both funnels use SAMPLE_LOG_100 so theoretically if a user's ID selects them for one funnel, they should be selected for the other too since the sampling is ID-based. Yet, when we compare which IDs can be found in LanguageSettings vs LanguageSearching, we get the following:

  settings.app_install_id IS NOT NULL AS `ID in LanguageSettings`,
  searches.app_install_id IS NOT NULL AS `ID in LanguageSearching`,
  COUNT(*) AS `IDs`
  SELECT DISTINCT event_app_install_id AS app_install_id
  FROM MobileWikiAppLanguageSettings_18113720
) AS settings
LEFT JOIN -- replace with RIGHT JOIN to get the remaining 9 IDs that are in searches but not settings
  (SELECT DISTINCT event_app_install_id AS app_install_id FROM MobileWikiAppLanguageSearching_18113721) AS searches
  ON settings.app_install_id = searches.app_install_id
GROUP BY `ID in LanguageSettings`, `ID in LanguageSearching`;
ID in LanguageSettingsID in LanguageSearchingIDs

So of the 952 unique IDs (query below), 687 (72%) have records in both LanguageSettings and LanguageSearching (although no shared session tokens as shown above), 256 (27%) have records in LanguageSettings but not in LanguageSearching (can't verify if this is what it should be since searched in LanguageSettings is broken), and 9 (1%) have records in LanguageSearching but not LanguageSettings.

  SELECT DISTINCT event_app_install_id AS id
  FROM MobileWikiAppLanguageSettings_18113720
  SELECT DISTINCT event_app_install_id AS id
  FROM MobileWikiAppLanguageSearching_18113721
) AS lang_search_set;
mpopov created this task.Tue, Jul 3, 6:18 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptTue, Jul 3, 6:18 PM
mpopov updated the task description. (Show Details)Tue, Jul 3, 6:25 PM
mpopov updated the task description. (Show Details)

Change 443674 had a related patch set uploaded (by Sharvaniharan; owner: Sharvaniharan):
[apps/android/wikipedia@master] Fix: Remove hard-coded value for 'searched' parameter

Change 443674 merged by jenkins-bot:
[apps/android/wikipedia@master] Fix: Remove hard-coded value for 'searched' parameter

Change 445536 had a related patch set uploaded (by Dbrant; owner: Dbrant):
[apps/android/wikipedia@master] Fix LanguageSettings and LanguageSearching funnels.