Skip to content

Commit f2c9177

Browse files
committed
feat(nimbus): Advanced targeting for users who have not accepted ToU yet and are on Mac or Win
1 parent 025cd85 commit f2c9177

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

experimenter/experimenter/targeting/constants.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,19 @@ def __post_init__(self):
3838
CORE_ACTIVE_USERS_TARGETING = "'{event}'|eventCountNonZero('Days', 28, 0) >= 21"
3939
RECENTLY_LOGGED_IN_USERS_TARGETING = "'{event}'|eventCountNonZero('Weeks', 12, 0) >= 1"
4040

41+
# The following indicate whether the user accepted the terms of use in one of our initial phases of experimentation/rollout
42+
ACCEPTED_TOU_IN_NIMBUS_EXPERIMENT = "'datareporting.policy.dataSubmissionPolicyAcceptedVersion'|preferenceValue == 3"
43+
# Accepted in 100% on-train rollout in 139 release (after "1747094400000" timestamp), or in earlier partial rollout indicated by presence of on-train rollout population value
44+
ACCEPTED_TOU_IN_ON_TRAIN_ROLLOUT = "(('browser.preonboarding.enrolledInOnTrainRollout'|preferenceValue && 'datareporting.policy.dataSubmissionPolicyAcceptedVersion'|preferenceValue == 2) && ('datareporting.policy.dataSubmissionPolicyNotifiedTime'|preferenceValue >= "1747094400000" || 'browser.preonboarding.onTrainRolloutPopulation'|preferenceValue))"
45+
ACCEPTED_TOU_V1 = "'termsofuse.acceptedVersion'|preferenceValue == 1"
46+
47+
# The following indicate whether the user has changed prefs suggesting they prefer not to see ads or ad-like features
48+
NEW_TAB_AND_HOMEPAGE_NOT_DEFAULT = "(!'browser.newtabpage.enabled'|preferenceValue && 'browser.startup.homepage'|preferenceValue != 'about:home')"
49+
SEARCH_SUGGESTIONS_DISABLED = "!'browser.urlbar.suggest.quicksuggest.sponsored'|preferenceValue"
50+
TOPSITES_DISABLED = "(!'browser.newtabpage.activity-stream.feeds.topsites'|preferenceValue || !'browser.newtabpage.activity-stream.showSponsoredTopSites'|preferenceValue)"
51+
STORIES_DISABLED = "(!'browser.newtabpage.activity-stream.feeds.section.topstories'|preferenceValue || !'browser.newtabpage.activity-stream.showSponsored'|preferenceValue)"
52+
ADS_DISABLED = f"(({NEW_TAB_AND_HOMEPAGE_NOT_DEFAULT} && {SEARCH_SUGGESTIONS_DISABLED}) || ({TOPSITES_DISABLED} && {STORIES_DISABLED} && {SEARCH_SUGGESTIONS_DISABLED}))"
53+
4154
NO_TARGETING = NimbusTargetingConfig(
4255
name="No Targeting",
4356
slug="no_targeting",
@@ -2527,6 +2540,21 @@ def __post_init__(self):
25272540
application_choice_names=(Application.DESKTOP.name,),
25282541
)
25292542

2543+
TOU_NOT_ACCEPTED_ADS_ENABLED_MAC_OR_WIN = NimbusTargetingConfig(
2544+
name="TOU not accepted yet, ads enabled, Mac or Win",
2545+
slug="tou_not_accepted_ads_enabled_mac_win",
2546+
description=(
2547+
"Users who have not accepted the terms of use yet, "
2548+
"have not disabled ads, "
2549+
"and are on Mac or Windows"
2550+
),
2551+
targeting=f"((os.isWindows || os.isMac) && !({ACCEPTED_TOU_IN_NIMBUS_EXPERIMENT} || {ACCEPTED_TOU_IN_ON_TRAIN_ROLLOUT} || {ACCEPTED_TOU_V1}) && !{ADS_DISABLED})"
2552+
""",
2553+
desktop_telemetry="",
2554+
sticky_required=False,
2555+
is_first_run_required=False,
2556+
application_choice_names=(Application.DESKTOP.name,),
2557+
)
25302558
25312559
class TargetingConstants:
25322560
TARGETING_VERSION = "version|versionCompare('{version}') >= 0"

0 commit comments

Comments
 (0)