This repository was archived by the owner on Feb 24, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathContextualOnboardingPixel.swift
156 lines (142 loc) · 6.2 KB
/
ContextualOnboardingPixel.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
//
// ContextualOnboardingPixel.swift
//
// Copyright © 2024 DuckDuckGo. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
import Foundation
import PixelKit
/**
* This enum keeps pixels related to the Contextual Onboarding.
*
* > Related links:
* [Privacy Triage]()
* [Detailed Pixels description](https://app.asana.com/0/1201621853593513/1208114308034584/f)
*/
enum ContextualOnboardingPixel: PixelKitEventV2 {
/**
* Event Trigger: User types into the address bar when the search suggestions dialog is shown during the contextual onboarding
*
* Anomaly Investigation:
* It is triggered in OnboardingSearchSuggestionsViewModel when one of the search suggestion button in the list is pressed (listItemPressed) in the contextual onboarding
* Check code in that area and in OnboardingPixelReporter to check it behaves as expected
*/
case siteSuggetionOptionTapped
/**
* Event Trigger: User types into the address bar when the search suggestions dialog is shown during the contextual onboarding
*
* Anomaly Investigation:
* It is triggered in OnboardingSiteSuggestionsViewModel when one of the site suggestion button in the list is pressed (listItemPressed) in the contextual onboarding
* Check code in that area and in OnboardingPixelReporter to check it behaves as expected
*/
case searchSuggetionOptionTapped
/**
* Event Trigger: User types into the address bar when the search suggestions dialog is shown during the contextual onboarding
*
* Anomaly Investigation:
* It is triggered in AddressBarTextField on controlTextDidChange.
* The OnboardingPixelReporter then sends a pixel if this happens when try a search onboarding dialog is on
* Check code in that area and in OnboardingPixelReporter to check it behaves as expected
*/
case onboardingSearchCustom
/**
* Event Trigger: User types into the address bar when the site suggestions dialog is shown during the contextual onboarding
*
* Anomaly Investigation:
* It is triggered in AddressBarTextField on controlTextDidChange.
* The OnboardingPixelReporter then sends a pixel if this happens when try a site onboarding dialog is on
* Check code in that area and in OnboardingPixelReporter to check it behaves as expected
*/
case onboardingVisitSiteCustom
/**
* Event Trigger: The “skip” button on the Fire Button dialog during the contextual onboarding
*
* Anomaly Investigation:
* It is triggered on skip in the OnboardingFireButtonDialogViewModel.
* Check code in that area to check it behaves as expected
*/
case onboardingFireButtonPromptSkipPressed
/**
* Event Trigger: The “skip” button on the Fire Button dialog during the contextual onboarding
*
* Anomaly Investigation:
* It is triggered on tryFireButton in the OnboardingFireButtonDialogViewModel.
* Check code in that area to check it behaves as expected
*/
case onboardingFireButtonTryItPressed
/**
* Event Trigger: The final onboarding dialog is displayed during the contextual onboarding
*
* Anomaly Investigation:
* It is triggered on when HighFive dialog is returned DefaultContextualDaxDialogViewFactory
* and on skip in the OnboardingFireButtonDialogViewModel.
* Check code in that area to check it behaves as expected
*/
case onboardingFinished
/**
* Event Trigger: The Fire button is clicked from the Fire Button dialog during the contextual onboarding
*
* Anomaly Investigation:
* It is triggered on fireButtonAction on MainMenuActions
* the OnboardingPixelProvider sends it only if the state non e' onboardingComleted
* Check code in that area to check it behaves as expected
*/
case onboardingFireButtonPressed
/**
* Event Trigger: The privacy dashboard is opened from the Trackers dialog during the contextual onboarding
*
* Anomaly Investigation:
* It is triggered on privacyEntryPointButtonAction on AddressBarButtonViewController
* the OnboardingPixelProvider sends it only if the state non e' onboardingComleted
* Check code in that area to check it behaves as expected
*/
case onboardingPrivacyDashboardOpened
/**
* Event Trigger:
* It is triggered on didFinishLoading on Tab only if it's not a search
* the OnboardingPixelProvider sends it only the second time
* Check code in that area to check it behaves as expected
*/
case secondSiteVisited
var name: String {
switch self {
case .onboardingSearchCustom:
return "m_mac_onboarding_search_custom_u"
case .onboardingVisitSiteCustom:
return "m_mac_onboarding_visit_site_custom_u"
case .onboardingFireButtonPromptSkipPressed:
return "m_mac_onboarding_fire_button_prompt_skip_pressed_u"
case .onboardingFinished:
return "m_mac_onboarding_finished_u"
case .onboardingFireButtonPressed:
return "m_mac_onboarding_fire_button_pressed_u"
case .onboardingPrivacyDashboardOpened:
return "m_mac_onboarding_privacy_dashboard_opened_u"
case .secondSiteVisited:
return "m_mac_second_site_visit_u"
case .searchSuggetionOptionTapped:
return "m_mac_onboarding_search_option_tapped_u"
case .siteSuggetionOptionTapped:
return "m_mac_onboarding_visit_site_option_tapped_u"
case .onboardingFireButtonTryItPressed:
return "m_mac_onboarding_fire_button_try_it_pressed_u"
}
}
var parameters: [String: String]? {
nil
}
var error: (any Error)? {
nil
}
}