mozilla-mobile / firefox-ios

Firefox for iOS
Mozilla Public License 2.0
12.21k stars 2.93k forks source link

Add trigger for sync feature #21788

Open data-sync-user opened 2 months ago

data-sync-user commented 2 months ago

So the behavioral targeting for the MVP for the Sync Microsurvey are the following:

┆Issue is synchronized with this Jira Task

data-sync-user commented 1 month ago

➤ Cyndi Chin commented:

Kamyar Ardekani Ray Fambro For the user is currently signed in to sync, can this be determined during app foreground? For example, when app foregrounds, then we check whether user is synced and if so, then we send an event?

data-sync-user commented 1 month ago

➤ Kamyar Ardekani commented:

Cyndi Chin

I don’t see why not. But I want to make sure I understand what this entails.

When the app foregrounds, the code will check if the user is signed into sync and sends an event if they are. This is in contrast to having a flag like days_since_install, where it’s not expressing an event, but a state of the user’s environment.

So there are two ways to go about this:

  1. Have an event that is sent on foreground after checking
  2. Have a flag that gets updated as the user’s sign in status changes state

Since, the user has to foreground before we can show the survey, in practice, these two should give us the same result?

What’s keeping us from doing it in the second way? It feels semantically more correct to me, but I’m not sure what practical difference it would make.

data-sync-user commented 1 month ago

➤ Cyndi Chin commented:

Kamyar Ardekani

Thanks for explaining! We can also express the state of the user’s environment. Instead of sending an event like sync, search, we can create a user preference and check whether "is_fxa_signed_in == true".

So this would follow similar to our existing trigger for default browser:

I_AM_NOT_DEFAULT_BROWSER: "is_default_browser == false"

Does this align with what you were originally thinking?

data-sync-user commented 1 month ago

➤ Kamyar Ardekani commented:

Cyndi Chin

Yes! For search, an event in time makes more sense (similar to homepage). But for sync, this new suggestion is better.

data-sync-user commented 1 month ago

➤ Cyndi Chin commented:

Kamyar Ardekani Great, thank you for confirming!

data-sync-user commented 1 month ago

➤ Cyndi Chin commented:

PR: https://github.com/mozilla-mobile/firefox-ios/pull/21932/files ( https://github.com/mozilla-mobile/firefox-ios/pull/21932/files )

data-sync-user commented 1 month ago

➤ Cyndi Chin commented:

Code has been merged,

Context We want to be able to show a microsurvey depending on whether a user is signed in and how many devices are synced.

User Cases

data-sync-user commented 3 weeks ago

➤ Adina Petridean commented:

Verified as fixed on Firefox 132.0(46292) with iPhone 14 Pro Max (iOS 16.2).