Skip to content

Commit

Permalink
Contextual Onboarding Pixels (#3177)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/1206329551987282/1207569383033366/f
**Description**:
Adds Pixels for Contextual Onboarding.
  • Loading branch information
alessandroboron committed Aug 5, 2024
1 parent 64e68cf commit 645085b
Show file tree
Hide file tree
Showing 27 changed files with 1,002 additions and 104 deletions.
4 changes: 4 additions & 0 deletions Core/Pixel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ public struct PixelParameters {

// Autofill
public static let countBucket = "count_bucket"

// Privacy Dashboard
public static let daysSinceInstall = "daysSinceInstall"
public static let fromOnboarding = "from_onboarding"
}

public struct PixelValues {
Expand Down
68 changes: 44 additions & 24 deletions Core/PixelEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ extension Pixel {
case forgetAllDataCleared

case privacyDashboardOpened

case privacyDashboardFirstTimeOpenedUnique

case dashboardProtectionAllowlistAdd
case dashboardProtectionAllowlistRemove

Expand Down Expand Up @@ -142,18 +143,27 @@ extension Pixel {
case onboardingIntroShownUnique
case onboardingIntroComparisonChartShownUnique
case onboardingIntroChooseBrowserCTAPressed

case daxDialogsSerp
case daxDialogsWithoutTrackers
case onboardingContextualSearchOptionTappedUnique
case onboardingContextualSearchCustomUnique
case onboardingContextualSiteOptionTappedUnique
case onboardingContextualSiteCustomUnique
case onboardingContextualSecondSiteVisitUnique
case onboardingContextualTrySearchUnique
case onboardingContextualTryVisitSiteUnique

case daxDialogsSerpUnique
case daxDialogsWithoutTrackersUnique
case daxDialogsWithoutTrackersFollowUp
case daxDialogsWithTrackers
case daxDialogsSiteIsMajor
case daxDialogsSiteOwnedByMajor
case daxDialogsHidden
case daxDialogsFireEducationShown
case daxDialogsFireEducationConfirmed
case daxDialogsFireEducationCancelled

case daxDialogsWithTrackersUnique
case daxDialogsSiteIsMajorUnique
case daxDialogsSiteOwnedByMajorUnique
case daxDialogsHiddenUnique
case daxDialogsFireEducationShownUnique
case daxDialogsFireEducationConfirmedUnique
case daxDialogsFireEducationCancelledUnique
case daxDialogsEndOfJourneyTabUnique
case daxDialogsEndOfJourneyNewTabUnique

case widgetsOnboardingCTAPressed
case widgetsOnboardingDeclineOptionPressed
case widgetsOnboardingMovedToBackground
Expand Down Expand Up @@ -759,7 +769,8 @@ extension Pixel.Event {
case .forgetAllDataCleared: return "mf_dc"

case .privacyDashboardOpened: return "mp"

case .privacyDashboardFirstTimeOpenedUnique: return "m_privacy_dashboard_first_time_used_unique"

case .dashboardProtectionAllowlistAdd: return "mp_wla"
case .dashboardProtectionAllowlistRemove: return "mp_wlr"

Expand Down Expand Up @@ -865,18 +876,27 @@ extension Pixel.Event {
case .onboardingIntroShownUnique: return "m_preonboarding_intro_shown_unique"
case .onboardingIntroComparisonChartShownUnique: return "m_preonboarding_comparison_chart_shown_unique"
case .onboardingIntroChooseBrowserCTAPressed: return "m_preonboarding_choose_browser_pressed"

case .daxDialogsSerp: return "m_dx_s"
case .daxDialogsWithoutTrackers: return "m_dx_wo"
case .onboardingContextualSearchOptionTappedUnique: return "m_onboarding_search_option_tapped_unique"
case .onboardingContextualSiteOptionTappedUnique: return "m_onboarding_visit_site_option_tapped_unique"
case .onboardingContextualSecondSiteVisitUnique: return "m_second_sitevisit_unique"
case .onboardingContextualSearchCustomUnique: return "m_onboarding_search_custom_unique"
case .onboardingContextualSiteCustomUnique: return "m_onboarding_visit_site_custom_unique"
case .onboardingContextualTrySearchUnique: return "m_dx_try_a_search_unique"
case .onboardingContextualTryVisitSiteUnique: return "m_dx_try_visit_site_unique"

case .daxDialogsSerpUnique: return "m_dx_s_unique"
case .daxDialogsWithoutTrackersUnique: return "m_dx_wo_unique"
case .daxDialogsWithoutTrackersFollowUp: return "m_dx_wof"
case .daxDialogsWithTrackers: return "m_dx_wt"
case .daxDialogsSiteIsMajor: return "m_dx_sm"
case .daxDialogsSiteOwnedByMajor: return "m_dx_so"
case .daxDialogsHidden: return "m_dx_h"
case .daxDialogsFireEducationShown: return "m_dx_fe_s"
case .daxDialogsFireEducationConfirmed: return "m_dx_fe_co"
case .daxDialogsFireEducationCancelled: return "m_dx_fe_ca"

case .daxDialogsWithTrackersUnique: return "m_dx_wt_unique"
case .daxDialogsSiteIsMajorUnique: return "m_dx_sm_unique"
case .daxDialogsSiteOwnedByMajorUnique: return "m_dx_so_unique"
case .daxDialogsHiddenUnique: return "m_dx_h_unique"
case .daxDialogsFireEducationShownUnique: return "m_dx_fe_s_unique"
case .daxDialogsFireEducationConfirmedUnique: return "m_dx_fe_co_unique"
case .daxDialogsFireEducationCancelledUnique: return "m_dx_fe_ca_unique"
case .daxDialogsEndOfJourneyTabUnique: return "m_dx_end_tab_unique"
case .daxDialogsEndOfJourneyNewTabUnique: return "m_dx_end_new_tab_unique"

case .widgetsOnboardingCTAPressed: return "m_o_w_a"
case .widgetsOnboardingDeclineOptionPressed: return "m_o_w_d"
case .widgetsOnboardingMovedToBackground: return "m_o_w_b"
Expand Down
16 changes: 12 additions & 4 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,9 @@
9F5E5AB22C3E606D00165F54 /* ContextualOnboardingPresenterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F5E5AB12C3E606D00165F54 /* ContextualOnboardingPresenterTests.swift */; };
9F69331B2C5A16E200CD6A5D /* OnboardingDaxFavouritesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F69331A2C5A16E200CD6A5D /* OnboardingDaxFavouritesTests.swift */; };
9F69331D2C5A191400CD6A5D /* MockTutorialSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F69331C2C5A191400CD6A5D /* MockTutorialSettings.swift */; };
9F6933192C59BB0300CD6A5D /* OnboardingPixelReporterMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F6933182C59BB0300CD6A5D /* OnboardingPixelReporterMock.swift */; };
9F69331F2C5B1D0C00CD6A5D /* OnFirstAppearViewModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F69331E2C5B1D0C00CD6A5D /* OnFirstAppearViewModifier.swift */; };
9F6933212C5B9A5B00CD6A5D /* OnboardingHostingControllerMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F6933202C5B9A5B00CD6A5D /* OnboardingHostingControllerMock.swift */; };
9F8007262C5261AF003EDAF4 /* MockPrivacyDataReporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F8007252C5261AF003EDAF4 /* MockPrivacyDataReporter.swift */; };
9F8FE9492BAE50E50071E372 /* Lottie in Frameworks */ = {isa = PBXBuildFile; productRef = 9F8FE9482BAE50E50071E372 /* Lottie */; };
9F9EE4CE2C377D4900D4118E /* OnboardingFirePixelMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F9EE4CC2C377D3F00D4118E /* OnboardingFirePixelMock.swift */; };
Expand Down Expand Up @@ -896,7 +899,6 @@
D668D92B2B696840008E2FF2 /* IdentityTheftRestorationPagesFeature.swift in Sources */ = {isa = PBXBuildFile; fileRef = D668D92A2B696840008E2FF2 /* IdentityTheftRestorationPagesFeature.swift */; };
D66F683D2BB333C100AE93E2 /* SubscriptionContainerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D66F683C2BB333C100AE93E2 /* SubscriptionContainerView.swift */; };
D670E5BB2BB6A75300941A42 /* SubscriptionNavigationCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = D670E5BA2BB6A75200941A42 /* SubscriptionNavigationCoordinator.swift */; };
D670E5BD2BB6AA0000941A42 /* View+AppearModifiers.swift in Sources */ = {isa = PBXBuildFile; fileRef = D670E5BC2BB6AA0000941A42 /* View+AppearModifiers.swift */; };
D67969112BC84CE700BA8B34 /* SubscriptionContainerViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D67969102BC84CE700BA8B34 /* SubscriptionContainerViewModel.swift */; };
D68A21442B7EC08500BB372E /* SubscriptionExternalLinkView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D68A21432B7EC08500BB372E /* SubscriptionExternalLinkView.swift */; };
D68A21462B7EC16200BB372E /* SubscriptionExternalLinkViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D68A21452B7EC16200BB372E /* SubscriptionExternalLinkViewModel.swift */; };
Expand Down Expand Up @@ -2394,6 +2396,9 @@
9F5E5AB12C3E606D00165F54 /* ContextualOnboardingPresenterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContextualOnboardingPresenterTests.swift; sourceTree = "<group>"; };
9F69331A2C5A16E200CD6A5D /* OnboardingDaxFavouritesTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingDaxFavouritesTests.swift; sourceTree = "<group>"; };
9F69331C2C5A191400CD6A5D /* MockTutorialSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockTutorialSettings.swift; sourceTree = "<group>"; };
9F6933182C59BB0300CD6A5D /* OnboardingPixelReporterMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingPixelReporterMock.swift; sourceTree = "<group>"; };
9F69331E2C5B1D0C00CD6A5D /* OnFirstAppearViewModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnFirstAppearViewModifier.swift; sourceTree = "<group>"; };
9F6933202C5B9A5B00CD6A5D /* OnboardingHostingControllerMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingHostingControllerMock.swift; sourceTree = "<group>"; };
9F8007252C5261AF003EDAF4 /* MockPrivacyDataReporter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockPrivacyDataReporter.swift; sourceTree = "<group>"; };
9F9EE4CC2C377D3F00D4118E /* OnboardingFirePixelMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingFirePixelMock.swift; sourceTree = "<group>"; };
9F9EE4D32C37BB1300D4118E /* OnboardingView+Landing.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "OnboardingView+Landing.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2631,7 +2636,6 @@
D668D92A2B696840008E2FF2 /* IdentityTheftRestorationPagesFeature.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IdentityTheftRestorationPagesFeature.swift; sourceTree = "<group>"; };
D66F683C2BB333C100AE93E2 /* SubscriptionContainerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionContainerView.swift; sourceTree = "<group>"; };
D670E5BA2BB6A75200941A42 /* SubscriptionNavigationCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionNavigationCoordinator.swift; sourceTree = "<group>"; };
D670E5BC2BB6AA0000941A42 /* View+AppearModifiers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+AppearModifiers.swift"; sourceTree = "<group>"; };
D67969102BC84CE700BA8B34 /* SubscriptionContainerViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionContainerViewModel.swift; sourceTree = "<group>"; };
D68A21432B7EC08500BB372E /* SubscriptionExternalLinkView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SubscriptionExternalLinkView.swift; sourceTree = "<group>"; };
D68A21452B7EC16200BB372E /* SubscriptionExternalLinkViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SubscriptionExternalLinkViewModel.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3090,6 +3094,7 @@
6FD3F80E2C3EF4F000DA5797 /* DeviceOrientationEnvironmentValue.swift */,
9FEA222D2C324ECD006B03BF /* ViewVisibility.swift */,
9FEA22282C2E38FA006B03BF /* AnimatableTypingText.swift */,
9F69331E2C5B1D0C00CD6A5D /* OnFirstAppearViewModifier.swift */,
);
name = SwiftUI;
sourceTree = "<group>";
Expand Down Expand Up @@ -4529,6 +4534,8 @@
children = (
9F9EE4CC2C377D3F00D4118E /* OnboardingFirePixelMock.swift */,
9F4CC5142C47AD08006A96EB /* ContextualOnboardingPresenterMock.swift */,
9F6933182C59BB0300CD6A5D /* OnboardingPixelReporterMock.swift */,
9F6933202C5B9A5B00CD6A5D /* OnboardingHostingControllerMock.swift */,
);
name = Mocks;
sourceTree = "<group>";
Expand Down Expand Up @@ -4968,7 +4975,6 @@
children = (
F1FDC9342BF51E41006B1435 /* VPNSettings+Environment.swift */,
D664C7982B289AA000CBFA76 /* WKUserContentController+Handler.swift */,
D670E5BC2BB6AA0000941A42 /* View+AppearModifiers.swift */,
);
path = Extensions;
sourceTree = "<group>";
Expand Down Expand Up @@ -7308,7 +7314,6 @@
984D035C24AE15CD0066CFB8 /* TabSwitcherSettings.swift in Sources */,
D6E83C562B21ECC1006C8AFB /* SettingsLegacyViewProvider.swift in Sources */,
98B31292218CCB8C00E54DE1 /* AppDependencyProvider.swift in Sources */,
D670E5BD2BB6AA0000941A42 /* View+AppearModifiers.swift in Sources */,
D6ACEA322BBD55BF008FADDF /* TabURLInterceptor.swift in Sources */,
C13F3F6A2B7F883A0083BE40 /* AuthConfirmationPromptViewController.swift in Sources */,
851624C72B96389D002D5CD7 /* HistoryDebugViewController.swift in Sources */,
Expand Down Expand Up @@ -7374,6 +7379,7 @@
CB84C7BD29A3EF530088A5B8 /* AppConfigurationURLProvider.swift in Sources */,
AA3D854723D9E88E00788410 /* AppIconSettingsCell.swift in Sources */,
316931D927BD22A80095F5ED /* DownloadActionMessageViewHelper.swift in Sources */,
9F69331F2C5B1D0C00CD6A5D /* OnFirstAppearViewModifier.swift in Sources */,
BDF8D0022C1B87F4003E3B27 /* NetworkProtectionDNSSettingsViewModel.swift in Sources */,
9838059F2228208E00385F1A /* PositiveFeedbackViewController.swift in Sources */,
8590CB67268A2E520089F6BF /* RootDebugViewController.swift in Sources */,
Expand Down Expand Up @@ -7561,6 +7567,8 @@
9F23B8062C2BE22700950875 /* OnboardingIntroViewModelTests.swift in Sources */,
9F69331D2C5A191400CD6A5D /* MockTutorialSettings.swift in Sources */,
85D2187424BF25CD004373D2 /* FaviconsTests.swift in Sources */,
9F6933212C5B9A5B00CD6A5D /* OnboardingHostingControllerMock.swift in Sources */,
9F6933192C59BB0300CD6A5D /* OnboardingPixelReporterMock.swift in Sources */,
56D0602D2C383FD2003BAEB5 /* OnboardingSuggestedSearchesProviderTests.swift in Sources */,
85AD49EE2B6149110085D2D1 /* CookieStorageTests.swift in Sources */,
569437242BDD405400C0881B /* SyncBookmarksAdapterTests.swift in Sources */,
Expand Down
3 changes: 2 additions & 1 deletion DuckDuckGo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,8 @@ import WebKit
privacyProDataReporter: privacyProDataReporter,
variantManager: variantManager,
contextualOnboardingPresenter: ContextualOnboardingPresenter(variantManager: variantManager),
contextualOnboardingLogic: daxDialogs)
contextualOnboardingLogic: daxDialogs,
contextualOnboardingPixelReporter: OnboardingPixelReporter())

main.loadViewIfNeeded()
syncErrorHandler.alertPresenter = main
Expand Down
Loading

0 comments on commit 645085b

Please sign in to comment.