@@ -20,192 +20,240 @@ import com.duckduckgo.app.statistics.pixels.Pixel.PixelType
2020import com.duckduckgo.app.statistics.pixels.Pixel.PixelType.Count
2121import com.duckduckgo.app.statistics.pixels.Pixel.PixelType.Daily
2222import com.duckduckgo.app.statistics.pixels.Pixel.PixelType.Unique
23+ import com.duckduckgo.common.utils.plugins.pixel.PixelParamRemovalPlugin.PixelParameter
24+ import com.duckduckgo.common.utils.plugins.pixel.PixelParamRemovalPlugin.PixelParameter.APP_VERSION
25+ import com.duckduckgo.common.utils.plugins.pixel.PixelParamRemovalPlugin.PixelParameter.ATB
2326
2427enum class SubscriptionPixel (
2528 val baseName : String ,
2629 private val types : Set <PixelType >,
2730 private val withSuffix : Boolean = true ,
31+ val includedParameters : Set <PixelParameter > = emptySet(),
2832) {
2933 SUBSCRIPTION_ACTIVE (
3034 baseName = " m_privacy-pro_app_subscription_active" ,
3135 type = Daily (),
36+ includedParameters = setOf (ATB , APP_VERSION ),
3237 ),
3338 OFFER_SCREEN_SHOWN (
3439 baseName = " m_privacy-pro_offer_screen_impression" ,
3540 type = Count ,
41+ includedParameters = setOf (ATB , APP_VERSION ),
3642 ),
3743 OFFER_SUBSCRIBE_CLICK (
3844 baseName = " m_privacy-pro_terms-conditions_subscribe_click" ,
3945 types = setOf (Count , Daily ()),
46+ includedParameters = setOf (ATB , APP_VERSION ),
4047 ),
4148 PURCHASE_FAILURE_OTHER (
4249 baseName = " m_privacy-pro_app_subscription-purchase_failure_other" ,
4350 types = setOf (Count , Daily ()),
51+ includedParameters = setOf (ATB , APP_VERSION ),
4452 ),
4553 PURCHASE_FAILURE_STORE (
4654 baseName = " m_privacy-pro_app_subscription-purchase_failure_store" ,
4755 types = setOf (Count , Daily ()),
56+ includedParameters = setOf (ATB , APP_VERSION ),
4857 ),
4958 PURCHASE_FAILURE_BACKEND (
5059 baseName = " m_privacy-pro_app_subscription-purchase_failure_backend" ,
5160 types = setOf (Count , Daily ()),
61+ includedParameters = setOf (ATB , APP_VERSION ),
5262 ),
5363 PURCHASE_FAILURE_ACCOUNT_CREATION (
5464 baseName = " m_privacy-pro_app_subscription-purchase_failure_account-creation" ,
5565 types = setOf (Count , Daily ()),
66+ includedParameters = setOf (ATB , APP_VERSION ),
5667 ),
5768 PURCHASE_SUCCESS (
5869 baseName = " m_privacy-pro_app_subscription-purchase_success" ,
5970 types = setOf (Count , Daily ()),
71+ includedParameters = setOf (ATB , APP_VERSION ),
6072 ),
6173 PURCHASE_SUCCESS_ORIGIN (
6274 baseName = " m_subscribe" ,
6375 type = Count ,
6476 withSuffix = false ,
77+ includedParameters = setOf (APP_VERSION ),
6578 ),
6679 OFFER_RESTORE_PURCHASE_CLICK (
6780 baseName = " m_privacy-pro_offer_restore-purchase_click" ,
6881 type = Count ,
82+ includedParameters = setOf (ATB , APP_VERSION ),
6983 ),
7084 ACTIVATE_SUBSCRIPTION_ENTER_EMAIL_CLICK (
7185 baseName = " m_privacy-pro_activate-subscription_enter-email_click" ,
7286 types = setOf (Count , Daily ()),
87+ includedParameters = setOf (ATB , APP_VERSION ),
7388 ),
7489 ACTIVATE_SUBSCRIPTION_RESTORE_PURCHASE_CLICK (
7590 baseName = " m_privacy-pro_activate-subscription_restore-purchase_click" ,
7691 types = setOf (Count , Daily ()),
92+ includedParameters = setOf (ATB , APP_VERSION ),
7793 ),
7894 RESTORE_USING_EMAIL_SUCCESS (
7995 baseName = " m_privacy-pro_app_subscription-restore-using-email_success" ,
8096 types = setOf (Count , Daily ()),
97+ includedParameters = setOf (ATB , APP_VERSION ),
8198 ),
8299 RESTORE_USING_STORE_SUCCESS (
83100 baseName = " m_privacy-pro_app_subscription-restore-using-store_success" ,
84101 types = setOf (Count , Daily ()),
102+ includedParameters = setOf (ATB , APP_VERSION ),
85103 ),
86104 RESTORE_USING_STORE_FAILURE_SUBSCRIPTION_NOT_FOUND (
87105 baseName = " m_privacy-pro_app_subscription-restore-using-store_failure_not-found" ,
88106 types = setOf (Count , Daily ()),
107+ includedParameters = setOf (ATB , APP_VERSION ),
89108 ),
90109 RESTORE_USING_STORE_FAILURE_OTHER (
91110 baseName = " m_privacy-pro_app_subscription-restore-using-store_failure_other" ,
92111 types = setOf (Count , Daily ()),
112+ includedParameters = setOf (ATB , APP_VERSION ),
93113 ),
94114 RESTORE_AFTER_PURCHASE_ATTEMPT_SUCCESS (
95115 baseName = " m_privacy-pro_app_subscription-restore-after-purchase-attempt_success" ,
96116 type = Count ,
117+ includedParameters = setOf (ATB , APP_VERSION ),
97118 ),
98119 SUBSCRIPTION_ACTIVATED (
99120 baseName = " m_privacy-pro_app_subscription_activated" ,
100121 type = Unique (),
122+ includedParameters = setOf (ATB , APP_VERSION ),
101123 ),
102124 ONBOARDING_ADD_DEVICE_CLICK (
103125 baseName = " m_privacy-pro_welcome_add-device_click" ,
104126 type = Unique (),
127+ includedParameters = setOf (ATB , APP_VERSION ),
105128 ),
106129 ONBOARDING_VPN_CLICK (
107130 baseName = " m_privacy-pro_welcome_vpn_click" ,
108131 type = Unique (),
132+ includedParameters = setOf (ATB , APP_VERSION ),
109133 ),
110134 ONBOARDING_PIR_CLICK (
111135 baseName = " m_privacy-pro_welcome_personal-information-removal_click" ,
112136 type = Unique (),
137+ includedParameters = setOf (ATB , APP_VERSION ),
113138 ),
114139 ONBOARDING_IDTR_CLICK (
115140 baseName = " m_privacy-pro_welcome_identity-theft-restoration_click" ,
116141 type = Unique (),
142+ includedParameters = setOf (ATB , APP_VERSION ),
117143 ),
118144 SUBSCRIPTION_SETTINGS_SHOWN (
119145 baseName = " m_privacy-pro_settings_screen_impression" ,
120146 type = Count ,
147+ includedParameters = setOf (ATB , APP_VERSION ),
121148 ),
122149 APP_SETTINGS_PIR_CLICK (
123150 baseName = " m_privacy-pro_app-settings_personal-information-removal_click" ,
124151 type = Count ,
152+ includedParameters = setOf (ATB , APP_VERSION ),
125153 ),
126154 APP_SETTINGS_IDTR_CLICK (
127155 baseName = " m_privacy-pro_app-settings_identity-theft-restoration_click" ,
128156 type = Count ,
157+ includedParameters = setOf (ATB , APP_VERSION ),
129158 ),
130159 APP_SETTINGS_GET_SUBSCRIPTION_CLICK (
131160 baseName = " m_privacy-pro_app-settings_get_click" ,
132161 type = Count ,
162+ includedParameters = setOf (APP_VERSION ),
133163 ),
134164 APP_SETTINGS_RESTORE_PURCHASE_CLICK (
135165 baseName = " m_privacy-pro_app-settings_restore-purchase_click" ,
136166 type = Count ,
167+ includedParameters = setOf (ATB , APP_VERSION ),
137168 ),
138169 SUBSCRIPTION_SETTINGS_CHANGE_PLAN_OR_BILLING_CLICK (
139170 baseName = " m_privacy-pro_settings_change-plan-or-billing_click" ,
140171 type = Count ,
172+ includedParameters = setOf (ATB , APP_VERSION ),
141173 ),
142174 SUBSCRIPTION_SETTINGS_REMOVE_FROM_DEVICE_CLICK (
143175 baseName = " m_privacy-pro_settings_remove-from-device_click" ,
144176 type = Count ,
177+ includedParameters = setOf (ATB , APP_VERSION ),
145178 ),
146179 SUBSCRIPTION_PRICE_MONTHLY_CLICK (
147180 baseName = " m_privacy-pro_offer_monthly-price_click" ,
148181 type = Count ,
182+ includedParameters = setOf (ATB , APP_VERSION ),
149183 ),
150184 SUBSCRIPTION_PRICE_YEARLY_CLICK (
151185 baseName = " m_privacy-pro_offer_yearly-price_click" ,
152186 type = Count ,
187+ includedParameters = setOf (ATB , APP_VERSION ),
153188 ),
154189 SUBSCRIPTION_ONBOARDING_FAQ_CLICK (
155190 baseName = " m_privacy-pro_welcome_faq_click" ,
156191 type = Unique (),
192+ includedParameters = setOf (ATB , APP_VERSION ),
157193 ),
158194 SUBSCRIPTION_ADD_EMAIL_SUCCESS (
159195 baseName = " m_privacy-pro_app_add-email_success" ,
160196 type = Unique (),
197+ includedParameters = setOf (ATB , APP_VERSION ),
161198 ),
162199 SUBSCRIPTION_PRIVACY_PRO_REDIRECT (
163200 baseName = " m_privacy-pro_app_redirect" ,
164201 type = Count ,
202+ includedParameters = setOf (ATB , APP_VERSION ),
165203 ),
166204 AUTH_V2_INVALID_REFRESH_TOKEN_DETECTED (
167205 baseName = " m_privacy-pro_auth_invalid_refresh_token_detected" ,
168206 types = setOf (Count , Daily ()),
207+ includedParameters = setOf (APP_VERSION ),
169208 ),
170209 AUTH_V2_INVALID_REFRESH_TOKEN_SIGNED_OUT (
171210 baseName = " m_privacy-pro_auth_invalid_refresh_token_signed_out" ,
172211 types = setOf (Count , Daily ()),
212+ includedParameters = setOf (APP_VERSION ),
173213 ),
174214 AUTH_V2_INVALID_REFRESH_TOKEN_RECOVERED (
175215 baseName = " m_privacy-pro_auth_invalid_refresh_token_recovered" ,
176216 types = setOf (Count , Daily ()),
217+ includedParameters = setOf (APP_VERSION ),
177218 ),
178219 AUTH_V2_MIGRATION_SUCCESS (
179220 baseName = " m_privacy-pro_auth_v2_migration_success" ,
180221 types = setOf (Count , Daily ()),
222+ includedParameters = setOf (APP_VERSION ),
181223 ),
182224 AUTH_V2_MIGRATION_FAILURE_IO (
183225 baseName = " m_privacy-pro_auth_v2_migration_failure_io" ,
184226 types = setOf (Count , Daily ()),
227+ includedParameters = setOf (APP_VERSION ),
185228 ),
186229 AUTH_V2_MIGRATION_FAILURE_INVALID_TOKEN (
187230 baseName = " m_privacy-pro_auth_v2_migration_failure_invalid_token" ,
188231 types = setOf (Count , Daily ()),
232+ includedParameters = setOf (APP_VERSION ),
189233 ),
190234 AUTH_V2_MIGRATION_FAILURE_OTHER (
191235 baseName = " m_privacy-pro_auth_v2_migration_failure_other" ,
192236 types = setOf (Count , Daily ()),
237+ includedParameters = setOf (APP_VERSION ),
193238 ),
194239 AUTH_V2_TOKEN_VALIDATION_ERROR (
195240 baseName = " m_privacy-pro_auth_v2_token_validation_error" ,
196241 types = setOf (Count , Daily ()),
242+ includedParameters = setOf (APP_VERSION ),
197243 ),
198244 AUTH_V2_TOKEN_STORE_ERROR (
199245 baseName = " m_privacy-pro_auth_v2_token_store_error" ,
200246 types = setOf (Count , Daily ()),
247+ includedParameters = setOf (APP_VERSION ),
201248 ),
202249 ;
203250
204251 constructor (
205252 baseName: String ,
206253 type: PixelType ,
207254 withSuffix: Boolean = true ,
208- ) : this (baseName, setOf (type), withSuffix)
255+ includedParameters: Set <PixelParameter > = emptySet(),
256+ ) : this (baseName, setOf (type), withSuffix, includedParameters)
209257
210258 fun getPixelNames (): Map <PixelType , String > =
211259 types.associateWith { type -> if (withSuffix) " ${baseName} _${type.pixelNameSuffix} " else baseName }
0 commit comments