Skip to content

Commit 4c94cf1

Browse files
authored
[Woo POS][Surveys] Update final survey URLs and add track events (#16248)
2 parents a1b6782 + e985bdf commit 4c94cf1

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

Modules/Sources/WooFoundationCore/Analytics/WooAnalyticsStat.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ public enum WooAnalyticsStat: String {
115115
case localNotificationTapped = "local_notification_tapped"
116116
case localNotificationDismissed = "local_notification_dismissed"
117117
case localNotificationScheduled = "local_notification_scheduled"
118+
case localNotificationDisplayed = "local_notification_displayed"
118119
case localNotificationCanceled = "local_notification_canceled"
119120

120121
// MARK: Dashboard View Events

WooCommerce/Classes/Analytics/WooAnalyticsEvent+LocalNotification.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ extension WooAnalyticsEvent {
2323
properties: getTracksProperties(type: type, userInfo: userInfo))
2424
}
2525

26+
static func displayed(type: String, userInfo: [AnyHashable: Any]) -> WooAnalyticsEvent {
27+
WooAnalyticsEvent(statName: .localNotificationDisplayed,
28+
properties: getTracksProperties(type: type, userInfo: userInfo))
29+
}
30+
2631
static func canceled(type: String, userInfo: [AnyHashable: Any]) -> WooAnalyticsEvent {
2732
WooAnalyticsEvent(statName: .localNotificationCanceled,
2833
properties: getTracksProperties(type: type, userInfo: userInfo))

WooCommerce/Classes/Notifications/LocalNotification.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ struct LocalNotification {
3535
case .productImageBackgroundUpload:
3636
return "product_image_background_upload"
3737
case .pointOfSalePotentialMerchant:
38-
return "point_of_sale_potential_merchant"
38+
return "woo_pos_survey_potential_user_survey"
3939
case .pointOfSaleCurrentMerchant:
40-
return "point_of_sale_current_merchant"
40+
return "woo_pos_survey_current_user_survey"
4141
case let .unknown(siteID):
4242
return "unknown_" + "\(siteID)"
4343
}
@@ -72,10 +72,9 @@ struct LocalNotification {
7272
static let surveyURL = "surveyURL"
7373
}
7474

75-
// periphery:ignore - real survey links to be added in WOOMOB-1497
7675
enum SurveyURL {
77-
static let pointOfSalePotentialMerchant = "https://automattic.survey.fm/woo-app-general-feedback-test-survey"
78-
static let pointOfSaleCurrentMerchant = "https://automattic.survey.fm/woo-app-general-feedback-test-survey"
76+
static let pointOfSalePotentialMerchant = "https://automattic.survey.fm/pos-survey-potential-users"
77+
static let pointOfSaleCurrentMerchant = "https://automattic.survey.fm/pos-survey-existing-users"
7978
}
8079
}
8180

WooCommerce/Classes/Notifications/PushNotificationsManager.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,9 @@ extension PushNotificationsManager {
264264
// Check if this is a local notification
265265
if !content.isRemoteNotification {
266266
// Display local notifications with banner and sound when app is in foreground
267+
let identifier = notification.request.identifier
268+
analytics.track(event: .LocalNotification.displayed(type: LocalNotification.Scenario.identifierForAnalytics(identifier),
269+
userInfo: content.userInfo))
267270
return [.banner, .sound, .list]
268271
}
269272
}

0 commit comments

Comments
 (0)