BTShopperInsightsClient
public class BTShopperInsightsClient
Use BTShopperInsightsClient
to optimize your checkout experience by prioritizing the customer’s preferred payment methods in your UI.
By customizing each customer’s checkout experience, you can improve conversion, increase sales/repeat buys and boost user retention/loyalty.
Warning
This feature is in beta. It’s public API may change or be removed in future releases.-
Creates a
BTShopperInsightsClient
Warning
This features only works with a client token.Declaration
Swift
public init(apiClient: BTAPIClient)
Parameters
apiClient
A
BTAPIClient
instance. -
getRecommendedPaymentMethods(request:
Asynchronousexperiment: ) This method confirms if the customer is a user of PayPal services using their email and phone number.
Warning
This feature is in beta. Its public API may change or be removed in future releases. PayPal recommendation is only available for US, AU, FR, DE, ITA, NED, ESP, Switzerland and UK merchants. Venmo recommendation is only available for US merchants.Declaration
Swift
public func getRecommendedPaymentMethods( request: BTShopperInsightsRequest, experiment: String? = nil ) async throws -> BTShopperInsightsResult
Parameters
request
Required: A
BTShopperInsightsRequest
containing the buyer’s user information.experiment
Optional: A
JSONObject
passed in as a string containing details of the merchant experiment.Return Value
A
BTShopperInsightsResult
instance -
Call this method when the PayPal button has been successfully displayed to the buyer. This method sends analytics to help improve the Shopper Insights feature experience.
Declaration
Swift
public func sendPayPalPresentedEvent(paymentMethodsDisplayed: [String?] = [], experiment: String? = nil)
Parameters
paymentMethodsDisplayed
Optional: The list of available payment methods, rendered in the same order in which they are displayed i.e. [‘Apple Pay’, ‘PayPal’]
experiment
Optional: A
JSONObject
passed in as a string containing details of the merchant experiment. -
Call this method when the PayPal button has been selected/tapped by the buyer. This method sends analytics to help improve the Shopper Insights feature experience
Declaration
Swift
public func sendPayPalSelectedEvent()
-
Call this method when the Venmo button has been successfully displayed to the buyer. This method sends analytics to help improve the Shopper Insights feature experience.
Declaration
Swift
public func sendVenmoPresentedEvent(paymentMethodsDisplayed: [String?] = [], experiment: String? = nil)
Parameters
paymentMethodsDisplayed
Optional: The list of available payment methods, rendered in the same order in which they are displayed.
experiment
Optional: A
JSONObject
passed in as a string containing details of the merchant experiment. -
Call this method when the Venmo button has been selected/tapped by the buyer. This method sends analytics to help improve the Shopper Insights feature experience
Declaration
Swift
public func sendVenmoSelectedEvent()