Bug 1821468 - Update the copy for the cookie banner experiment

fenix/112.0
Arturo Mejia 1 year ago committed by mergify[bot]
parent 09a3702050
commit 784f651e8b

@ -105,8 +105,7 @@ features:
{
"feature-ui": 0,
"feature-setting-value": 0,
"dialog-re-engage-time": 4,
"dialog-text-variant": 0,
"dialog-re-engage-time": 4
}
defaults:
- channel: developer
@ -114,8 +113,7 @@ features:
"sections-enabled": {
"feature-ui": 1,
"feature-setting-value": 0,
"dialog-re-engage-time": 4,
"dialog-text-variant": 0,
"dialog-re-engage-time": 4
}
}
- channel: nightly
@ -123,8 +121,7 @@ features:
"sections-enabled": {
"feature-ui": 1,
"feature-setting-value": 0,
"dialog-re-engage-time": 4,
"dialog-text-variant": 0,
"dialog-re-engage-time": 4
}
}
unified-search:
@ -244,10 +241,6 @@ types:
description: An integer indicating the number of hours that needs to happen before
the re-engagement dialog shows again since the last seen, for example if set to 4
that means if the users has seen the dialog, it will see it 4 hours later.
dialog-text-variant:
description: An integer from 0 to 2, indicating which text variant should be used on the re-engagement dialog.
0 to indicate the variant control should be used, 1 indicates the variant 1 should be used,
2 indicates the variant 2 should be used, each variant can be found in the mockups for cookie banner handling.
OnboardingPanel:
description: The types of onboarding panels in the onboarding page
variants:

@ -36,12 +36,27 @@ class CookieBannerReEngagementDialog : DialogFragment() {
setContent {
FirefoxTheme {
val cookieBannerDialogSelectedVariant =
CookieBannerReEngagementDialogUtils.getCookieBannerDialogVariants(requireContext())
val title =
context.getString(
R.string.reduce_cookie_banner_dialog_title,
context.getString(R.string.app_name),
)
val message =
context.getString(
R.string.reduce_cookie_banner_dialog_body,
context.getString(R.string.app_name),
)
val allowButtonText =
context.getString(
R.string.reduce_cookie_banner_dialog_change_setting_button,
)
CookieBannerReEngagementDialogCompose(
dialogTitle = cookieBannerDialogSelectedVariant.title,
dialogText = cookieBannerDialogSelectedVariant.message,
allowButtonText = cookieBannerDialogSelectedVariant.positiveTextButton,
dialogTitle = title,
dialogText = message,
allowButtonText = allowButtonText,
declineButtonText = getString(R.string.reduce_cookie_banner_dialog_not_now_button),
onAllowButtonClicked = {
CookieBanners.allowReEngagementDialog.record(NoExtras())

@ -4,82 +4,19 @@
package org.mozilla.fenix.settings.quicksettings.protections.cookiebanners.dialog
import android.content.Context
import androidx.navigation.NavController
import mozilla.components.concept.engine.EngineSession.CookieBannerHandlingMode.REJECT_ALL
import mozilla.components.concept.engine.EngineSession.CookieBannerHandlingStatus
import org.mozilla.fenix.R
import org.mozilla.fenix.browser.BrowserFragmentDirections
import org.mozilla.fenix.ext.nav
import org.mozilla.fenix.nimbus.CookieBannersSection
import org.mozilla.fenix.nimbus.FxNimbus
import org.mozilla.fenix.utils.Settings
import mozilla.components.concept.engine.Settings as EngineSettings
private const val CONTROL_VARIANT = 0
private const val VARIANT_ONE = 1
private const val VARIANT_TWO = 2
/**
* An utility object for interacting with the re-engagement cookie banner dialog.
*/
object CookieBannerReEngagementDialogUtils {
/**
* Returns a the current [CookieBannerDialogVariant] to the given nimbus experiment.
*/
fun getCookieBannerDialogVariants(context: Context): CookieBannerDialogVariant {
val textVariant =
FxNimbus.features.cookieBanners.value().sectionsEnabled[CookieBannersSection.DIALOG_TEXT_VARIANT]
return when (textVariant) {
CONTROL_VARIANT -> CookieBannerDialogVariant(
title = context.getString(R.string.reduce_cookie_banner_control_experiment_dialog_title),
message = context.getString(
R.string.reduce_cookie_banner_control_experiment_dialog_body_2,
context.getString(
R.string.app_name,
),
),
positiveTextButton = context.getString(
R.string.reduce_cookie_banner_control_experiment_dialog_change_setting_button,
),
)
VARIANT_ONE -> CookieBannerDialogVariant(
title = context.getString(R.string.reduce_cookie_banner_variant_1_experiment_dialog_title),
message = context.getString(
R.string.reduce_cookie_banner_variant_1_experiment_dialog_body_1,
context.getString(R.string.app_name),
),
positiveTextButton = context.getString(
R.string.reduce_cookie_banner_variant_1_experiment_dialog_change_setting_button,
),
)
VARIANT_TWO -> CookieBannerDialogVariant(
title = context.getString(R.string.reduce_cookie_banner_variant_2_experiment_dialog_title),
message = context.getString(
R.string.reduce_cookie_banner_variant_2_experiment_dialog_body_1,
context.getString(R.string.app_name),
),
positiveTextButton = context.getString(
R.string.reduce_cookie_banner_variant_2_experiment_dialog_change_setting_button,
),
)
else -> {
CookieBannerDialogVariant(
title = context.getString(R.string.reduce_cookie_banner_control_experiment_dialog_title),
message = context.getString(
R.string.reduce_cookie_banner_control_experiment_dialog_body_2,
context.getString(
R.string.app_name,
),
),
positiveTextButton = context.getString(
R.string.reduce_cookie_banner_control_experiment_dialog_change_setting_button,
),
)
}
}
}
/**
* Tries to show the re-engagement cookie banner dialog, when the right conditions are met, o
* otherwise the dialog won't show.
@ -115,16 +52,4 @@ object CookieBannerReEngagementDialogUtils {
engineSettings.cookieBannerHandlingMode = REJECT_ALL
}
}
/**
* Data class for cookie banner dialog variant
* @property title of the dialog
* @property message of the dialog
* @property positiveTextButton indicates the text of the positive button of the dialog
*/
data class CookieBannerDialogVariant(
val title: String,
val message: String,
val positiveTextButton: String,
)
}

@ -368,35 +368,41 @@
<!-- Long text for a detail explanation indicating what will happen if cookie banner handling is on for a site, this is shown as part of the cookie banner panel in the toolbar. The first parameter is the application name -->
<string name="reduce_cookie_banner_details_panel_description_on_for_site_2">%1$s tries to automatically reject all cookie requests on supported sites.</string>
<!-- Title text for the dialog use on the control branch of the experiment to determine which context users engaged the most -->
<string name="reduce_cookie_banner_control_experiment_dialog_title">Cookie banners begone!</string>
<string name="reduce_cookie_banner_control_experiment_dialog_title" moz:RemovedIn="112" tools:ignore="UnusedResources">Allow Firefox to reject cookie banners?</string>
<!-- Title text for the cookie banner re-engagement dialog. The first parameter is the application name. -->
<string name="reduce_cookie_banner_dialog_title">Allow %1$s to reject cookie banners?</string>
<!-- Body text for the dialog use on the control branch of the experiment to determine which context users engaged the most -->
<string name="reduce_cookie_banner_control_experiment_dialog_body" moz:RemovedIn="110" tools:ignore="UnusedResources">Automatically reject cookie requests, when possible. Otherwise, accept all cookies to dismiss cookie banners.</string>
<!-- Body text for the dialog use on the control branch of the experiment to determine which context users engaged the most -->
<string name="reduce_cookie_banner_control_experiment_dialog_body_1" moz:RemovedIn="111" tools:ignore="UnusedResources">Automatically reject cookie requests, when possible.</string>
<!-- Body text for the dialog use on the control branch of the experiment to determine which context users engaged the most.The first parameter is the application name -->
<string name="reduce_cookie_banner_control_experiment_dialog_body_2">Allow %1$s to automatically reject cookie requests when possible?</string>
<string name="reduce_cookie_banner_control_experiment_dialog_body_2" moz:RemovedIn="112" tools:ignore="UnusedResources">Allow %1$s to automatically reject cookie requests when possible?</string>
<!-- Body text for the cookie banner re-engagement dialog use. The first parameter is the application name. -->
<string name="reduce_cookie_banner_dialog_body">%1$s can automatically reject many cookie banner requests.</string>
<!-- Remind me later text button for the onboarding dialog -->
<string name="reduce_cookie_banner_dialog_not_now_button">Not Now</string>
<!-- Change setting text button, for the dialog use on the control branch of the experiment to determine which context users engaged the most -->
<string name="reduce_cookie_banner_control_experiment_dialog_change_setting_button">Dismiss banners</string>
<string name="reduce_cookie_banner_control_experiment_dialog_change_setting_button" moz:RemovedIn="112" tools:ignore="UnusedResources">Dismiss banners</string>
<!-- Snack text for the cookie banner dialog, after user hit the dismiss banner button -->
<string name="reduce_cookie_banner_dialog_snackbar_text">Youll see fewer cookie requests</string>
<!-- Title text for the dialog use on the variant 1 branch of the experiment to determine which context users engaged the most -->
<string name="reduce_cookie_banner_variant_1_experiment_dialog_title">See fewer cookie pop-ups</string>
<string name="reduce_cookie_banner_variant_1_experiment_dialog_title" moz:RemovedIn="112" tools:ignore="UnusedResources">See fewer cookie pop-ups</string>
<!-- Body text for the dialog use on the variant 1 branch of the experiment to determine which context users engaged the most. The first parameter is the application name. -->
<string name="reduce_cookie_banner_variant_1_experiment_dialog_body" moz:RemovedIn="110" tools:ignore="UnusedResources">Automatically answer cookie pop-ups for distraction-free browsing. %1$s will reject all requests if possible, or accept all if not.</string>
<!-- Body text for the dialog use on the variant 1 branch of the experiment to determine which context users engaged the most. The first parameter is the application name. -->
<string name="reduce_cookie_banner_variant_1_experiment_dialog_body_1">Automatically answer cookie pop-ups for distraction-free browsing. %1$s will reject all requests if possible.</string>
<string name="reduce_cookie_banner_variant_1_experiment_dialog_body_1" moz:RemovedIn="112" tools:ignore="UnusedResources">Automatically answer cookie pop-ups for distraction-free browsing. %1$s will reject all requests if possible.</string>
<!-- Change setting text button, for the onboarding dialog use on the variant 1 branch of the experiment to determine which context users engaged the most -->
<string name="reduce_cookie_banner_variant_1_experiment_dialog_change_setting_button">Dismiss Pop-ups</string>
<string name="reduce_cookie_banner_variant_1_experiment_dialog_change_setting_button" moz:RemovedIn="112" tools:ignore="UnusedResources">Dismiss Pop-ups</string>
<!-- Title text for the dialog use on the variant 2 branch of the experiment to determine which context users engaged the most -->
<string name="reduce_cookie_banner_variant_2_experiment_dialog_title">Cookie Banner Reduction</string>
<string name="reduce_cookie_banner_variant_2_experiment_dialog_title" moz:RemovedIn="112" tools:ignore="UnusedResources">Cookie Banner Reduction</string>
<!-- Body text for the dialog use on the variant 2 branch of the experiment to determine which context users engaged the most. The first parameter is the application name. -->
<string name="reduce_cookie_banner_variant_2_experiment_dialog_body" moz:RemovedIn="110" tools:ignore="UnusedResources">Allow %1$s to decline a sites cookie consent request if possible or accept cookie access when not possible?</string>
<!-- Body text for the dialog use on the variant 2 branch of the experiment to determine which context users engaged the most. The first parameter is the application name. -->
<string name="reduce_cookie_banner_variant_2_experiment_dialog_body_1">Allow %1$s to decline a sites cookie consent request if possible?</string>
<string name="reduce_cookie_banner_variant_2_experiment_dialog_body_1" moz:RemovedIn="112" tools:ignore="UnusedResources">Allow %1$s to decline a sites cookie consent request if possible?</string>
<!-- Change setting text button, for the dialog use on the variant 2 branch of the experiment to determine which context users engaged the most -->
<string name="reduce_cookie_banner_variant_2_experiment_dialog_change_setting_button">Allow</string>
<string name="reduce_cookie_banner_variant_2_experiment_dialog_change_setting_button" moz:RemovedIn="112" tools:ignore="UnusedResources">Allow</string>
<!-- Change setting text button, for the cookie banner re-engagement dialog -->
<string name="reduce_cookie_banner_dialog_change_setting_button">Allow</string>
<!-- Description of the preference to enable "HTTPS-Only" mode. -->
<string name="preferences_https_only_summary">Automatically attempts to connect to sites using HTTPS encryption protocol for increased security.</string>

Loading…
Cancel
Save