mozilla-mobile / fenix

⚠️ Fenix (Firefox for Android) moved to a new repository. It is now developed and maintained as part of: https://github.com/mozilla-mobile/firefox-android
https://github.com/mozilla-mobile/firefox-android
Mozilla Public License 2.0
6.48k stars 1.28k forks source link

[Meta] Integration of Leanplum Events, Attributes & Deeplinks #4421

Closed lwa-moz closed 5 years ago

lwa-moz commented 5 years ago

Why/User Benefit/User Problem

As a Marketer I want to be able to educated users about useful features or services that are relevant to the user at their specific stage of using the product. I want to make sure I am not providing redundant or irrelevant information so as to ensure I am providing value to the user and not annoying them.

I also want to ensure that when a user is being told about a feature/service, they can easily access the feature/service through a deeplink.

What/Requirements

Q3 Requirements Documented here: https://docs.google.com/spreadsheets/d/1vp3Km7qyyAvkDiUQ3b4lRQUFyA7DQixR8xP1VadA4iw/edit#gid=1742911874

These requirements are repeated here, Top Event Priorities

Top Attribute Priorities

Top Deeplink Priorities

Acceptance Criteria (how do I know when I’m done?)

Events and attributes have been integrated and validated by Marketing QA.

FOR QA: to test the deep links use: adb shell am start -W -a android.intent.action.VIEW -d "fenix://private_browsing" where the deep link follows the -d flag.

┆Issue is synchronized with this Jira Task

vesta0 commented 5 years ago

@boek would you please take a look at #3060 and #3059 and close them if they are already covered here?

liuche commented 5 years ago

Some of these LeanPlum things are already in-product - check them off and don't duplicate them?

lwa-moz commented 5 years ago

FxA Signup Event Bug (in Fennec): https://bugzilla.mozilla.org/show_bug.cgi?id=1568605

Leanplum Documentation for: Events - https://docs.leanplum.com/reference#events Attributes - https://docs.leanplum.com/reference#user-attributes

sblatz commented 5 years ago

@jyeontaek will pick up the search widget portion 😄

lnicola commented 5 years ago

Will it be possible to disable Leanplum at all? If yes, will there be a separate toggle from Telemetry like in Fennec (FHR vs. Telemetry)?

sblatz commented 5 years ago

@lnicola Hey thanks for asking! You can disable all telemetry data with the data collection toggle: Settings > Data collection > Usage and technical data OFF

lnicola commented 5 years ago

@sblatz thank you, but in Fennec I keep Telemetry enabled, but disable FHR to avoid sending data to third parties and because I'm not interested in marketing push notifications and the like.

I leave Telemetry on because I'm fine sending technical data, although I realize that -- at least in Fenix -- it also contains a lot of interaction data.

sblatz commented 5 years ago

@lnicola Ah, that's a great point! Appreciate your feedback. I've filed #4663 to address this and will raise it with product ASAP 😄

vesta0 commented 5 years ago

Historically in Fennec, telemetry collects browser and feature usage data (including attributes for 3rd party apps such as LeanPlum), whereas Firefox Health Report collects stability and performance information about the browser to help us improve performance and fix problems.

lnicola commented 5 years ago

https://firefox-source-docs.mozilla.org/mobile/android/fennec/mma.html says

Who will have Leanplum enabled? If the user has “Health Report” setting enabled.

Is that incorrect or incomplete? If so, that's pretty bad.

lwa-moz commented 5 years ago

Strongly in support of the functionality mentioned in https://github.com/mozilla-mobile/fenix/issues/4663, and @lnicola 's related comment that Health Report and Leanplum data should be kept separate.

We want to give users full transparency and control over what data is collected, and also allow them to turn off notifications. We shouldn't conflate the data collected to send contextual notifications about the product with data collected to ensure the product works correctly.

sblatz commented 5 years ago

QA: can you please verify the items that have checkmarks? :)

AndiAJ commented 5 years ago

Hi, just finished testing on Fenix 1.3.0-rc.3 from 19/8.

Please review the following:

1. Top Event Priorities

Logcat Glean dashboard

Remarks

FxA Sign-up ❓ - as per #3060 when signing up/signing in rename_button from the collections sections gets triggered

User creates a new Collection ❓ - Not sure, I had 4 open tabs and added 2 tabs to a collection, meaning that I should have 2 tabs_open and 2 tabs_selected.

This is how it got generated: "timestamp": 7233, "category": "collections", "name": "saved", "extra": { "tabs_open": "6", "tabs_selected": "2"

No ping was created for Cleared Private Data ❌

2.Top Attribute Priorities

History Ping 908d9601-c895-4162-9d29-a40eeff37c87 Ping 53fc8e64-952a-4457-98f2-21d729e1973e

Bookmarks Ping 8f6aeefb-8524-41cb-ab4b-9f231d1f4e1d Ping 1ce50e23-5a78-4171-9b66-46530d8d6282

Logcat Glean dashboard

Logcat Glean dashboard

Widget ✔️ •Tap on Widget Fenix icon Ping f41750e7-84ab-45ca-9d55-44d8137f0364 •Tap on "Search the web" from the widget Ping 2e7a45e2-eefc-4080-a2a4-041607ae6405 •Tap on the microphone from the widget Ping 3013f8ae-da32-4214-9f80-ee3feaeccfe7

Logcat Glean dashboard

Remarks

Signed In Sync ❓ - the rename_button from the collections sections gets triggered Sync items ❓ - Not sure, but as mentioned in #3060 after after signing in, the sync starts automatically, and it generates 2x bookmarks_sync & 2x history_sync afterwards 1 for each.

3.Top Deeplink Priorities

Link to Set Default Browser settings ✔️ adb shell am start -W -a android.intent.action.VIEW -d "fenix://make_default_browser"

Link to sync signup/sign in ✔️ adb shell am start -W -a android.intent.action.VIEW -d "fenix://turn_on_sync"

Link to default search engine settings ✔️ adb shell am start -W -a android.intent.action.VIEW -d "fenix://settings_search_engine"

Link to Collections ✔️ (Sawyer: this is covered by a "home screen" link.) adb shell am start -W -a android.intent.action.VIEW -d "fenix://home"

Link to main preferences ✔️ adb shell am start -W -a android.intent.action.VIEW -d "fenix://settings"

Link to accessibility preferences ✔️ adb shell am start -W -a android.intent.action.VIEW -d "fenix://settings_accessibility"

Link to private browsing ✔️ (Sawyer: do we just want this to enable private browsing?) adb shell am start -W -a android.intent.action.VIEW -d "fenix://enable_private_browsing"

Link to clear all private data ✔️ adb shell am start -W -a android.intent.action.VIEW -d "fenix://settings_delete_browsing_data"

Link to web page ✔️ adb shell am start -W -a android.intent.action.VIEW -d "https://www.theverge.com"

Remarks

Link to web page ✔️ - not sure if I proceeded accordingly, I've set Fenix as default browser and afterwards used the above mentioned command, no issues encountered, it worked properly.

Is this the correct way to use the link to web page deeplink

@sblatz - Please be kind and review the above mentioned remarks. Help me clarify the matters that have the ❓ sign. And check the Clear Private Data ❌ issue

sblatz commented 5 years ago

@AndiAJ I have a PR up to address all but the "Clear private data" issue. Are you not seeing the event generated in leanplum? It should not be tracked in Glean. Leanplum should just have an E_Cleared_Private_Data event.

Please also verify that you're seeing E_New_Sign_Up_FxA as a Leanplum event.

Link to web page ✔️ - not sure if I proceeded accordingly, I've set Fenix as default browser and afterwards used the above mentioned command, no issues encountered, it worked properly.

You can actually do: adb shell am start -W -a android.intent.action.VIEW -d "fenix://open?url=https://www.theverge.com"

to test that event. What you did works, but was already working prior to this patch :)

AndiAJ commented 5 years ago

Hi @sblatz, great news! the E_Cleared_Private_Data & E_New_Sign_Up_FxA were successfully generated in Leanplum and the Link to web page Deeplink works!

Details c9251dbd-6303-4472-a36a-a3bffd5f4669 Is developer: No Devices: c9251dbd-6303-4472-a36a-a3bffd5f4669 Leanplum account owner: None Register as test device Created: August 21, 2019, 3:17 pm Last active: August 21, 2019, 3:19 pm Model: Google Pixel 3a System name: Android OS System version: 9 App version: 1.3.0-rc.3 Android push token: None Country: RO Region: cj City: cluj-napoca Location accuracy: ip Locale: en_US User attributes: default_browser: fennec_installed: True focus_installed: True fxa_has_synced_items: True fxa_signed_in: True klar_installed: True search_widget_installed: False Time spent in app: 0 seconds Number of sessions: 1 User bucket: 291 Milestones Convert to my time zone August 21, 2019 5:17:10 am PDT Created 5:17:10 am PDT First E_Opened_App 5:17:10 am PDT E_Opened_App_FirstRun 5:17:10 am PDT Last Session 5:18:04 am PDT Last E_Opened_App(Lifetime occurrences: 2) 5:18:36 am PDT E_New_Sign_Up_FxA 5:18:36 am PDT E_Sign_In_FxA 5:18:47 am PDT E_Interact_With_Search_URL_Area 5:19:07 am PDT E_Add_Bookmark 5:19:22 am PDT E_Cleared_Private_Data 5:19:24 am PDT Last Active [Leanplum link](https://www.leanplum.com/dashboard#/4828751897952256/users/%7B%22userId%22:%22c9251dbd-6303-4472-a36a-a3bffd5f4669%22,%22showUserProfile%22:true%7D)