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 init is beta. It’s public API may change or be removed in future releases. This feature only works with a client token.Declaration
Swift
public init(apiClient: BTAPIClient, shopperSessionID: String? = nil)
Parameters
apiClient
A
BTAPIClient
instance.shopperSessionID
This value should be the shopper session ID returned from your server SDK request
-
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 or 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 sendPresentedEvent(for buttonType: BTButtonType, presentmentDetails: BTPresentmentDetails)
Parameters
buttonType
Type of button presented - PayPal, Venmo, or Other
presentmentDetails
Detailed information, including button order, experiment type, and page type about the payment button that is sent to analytics to help improve the Shopper Insights feature experience.
-
Call this method when a button has been selected/tapped by the buyer. This method sends analytics to help improve the Shopper Insights feature experience.
Warning
This function is in beta. It’s public API may change or be removed in future releases.Declaration
Swift
public func sendSelectedEvent(for buttonType: BTButtonType)
Parameters
buttonType
Type of button presented - PayPal, Venmo, or Other
-
Indicates whether the PayPal App is installed.
Warning
This method is currently in beta and may change or be removed in future releases.Declaration
Swift
public func isPayPalAppInstalled() -> Bool
-
Indicates whether the Venmo App is installed.
Warning
This method is currently in beta and may change or be removed in future releases.Declaration
Swift
public func isVenmoAppInstalled() -> Bool