Skip to content

Commit 98aade7

Browse files
committed
PayPalWebCheckout analytics
1 parent 2695c83 commit 98aade7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Sources/PayPalWebPayments/PayPalWebCheckoutClient.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ public class PayPalWebCheckoutClient: NSObject {
3535
/// if it fails, `PayPalWebCheckoutResult will be `nil` and `error` will describe the failure
3636
public func start(request: PayPalWebCheckoutRequest, completion: @escaping (PayPalWebCheckoutResult?, CoreSDKError?) -> Void) {
3737
analyticsService = AnalyticsService(coreConfig: config, orderID: request.orderID)
38-
analyticsService?.sendEvent("paypal-web-payments:started")
39-
38+
analyticsService?.sendEvent("paypal-web-payments:checkout:started")
39+
4040
let baseURLString = config.environment.payPalBaseURL.absoluteString
4141
let payPalCheckoutURLString =
4242
"\(baseURLString)/checkoutnow?token=\(request.orderID)" +
@@ -54,9 +54,9 @@ public class PayPalWebCheckoutClient: NSObject {
5454
context: self,
5555
sessionDidDisplay: { [weak self] didDisplay in
5656
if didDisplay {
57-
self?.analyticsService?.sendEvent("paypal-web-payments:browser-presentation:succeeded")
57+
self?.analyticsService?.sendEvent("paypal-web-payments:checkout:auth-challenge-presentation:succeeded")
5858
} else {
59-
self?.analyticsService?.sendEvent("paypal-web-payments:browser-presentation:failed")
59+
self?.analyticsService?.sendEvent("paypal-web-payments:checkout:auth-challenge-presentation:failed")
6060
}
6161
},
6262
sessionDidComplete: { url, error in
@@ -203,17 +203,17 @@ public class PayPalWebCheckoutClient: NSObject {
203203
}
204204

205205
private func notifyCheckoutSuccess(for result: PayPalWebCheckoutResult, completion: (PayPalWebCheckoutResult?, CoreSDKError?) -> Void) {
206-
self.analyticsService?.sendEvent("paypal-web-payments:succeeded")
206+
self.analyticsService?.sendEvent("paypal-web-payments:checkout:auth-challenge-succeeded")
207207
completion(result, nil)
208208
}
209209

210210
private func notifyCheckoutFailure(with error: CoreSDKError, completion: (PayPalWebCheckoutResult?, CoreSDKError?) -> Void) {
211-
self.analyticsService?.sendEvent("paypal-web-payments:failed")
211+
self.analyticsService?.sendEvent("paypal-web-payments:checkout:auth-challenge-failed")
212212
completion(nil, error)
213213
}
214214

215215
private func notifyCheckoutCancelWithError(with error: CoreSDKError, completion: (PayPalWebCheckoutResult?, CoreSDKError?) -> Void) {
216-
analyticsService?.sendEvent("paypal-web-payments:browser-login:canceled")
216+
analyticsService?.sendEvent("paypal-web-payments:checkout:auth-challenge-canceled")
217217
completion(nil, error)
218218
}
219219

0 commit comments

Comments
 (0)