BTShopperInsightsClientV2
public class BTShopperInsightsClientV2
Use BTShopperInsightsClientV2 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.
The use of this client is a completely separate integration path from the deprecated BTShopperInsightsClient
Warning
This feature is in beta. It’s public API may change or be removed in future releases.-
Creates a
BTShopperInsightsClientV2Warning
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(authorization: String)Parameters
authorizationA valid client token or tokenization key used to authorize API calls.
-
createCustomerSession(request:Asynchronous) This method creates a new customer session.
Throws
An error if the request fails for some reason or if the response is invalid.Warning
This method is currently in beta and may change or be removed in future releases.Declaration
Swift
public func createCustomerSession(request: BTCustomerSessionRequest) async throws -> StringParameters
requestReturn Value
A
Stringrepresenting a session ID if successful -
updateCustomerSession(request:AsynchronoussessionID: ) This method updates an existing customer session.
Throws
An error if the request fails for some reason or if the response is invalid.Warning
This method is currently in beta and may change or be removed in future releases.Declaration
Swift
public func updateCustomerSession(request: BTCustomerSessionRequest, sessionID: String) async throws -> StringParameters
requestsessionIDthe ID of the session to update
Return Value
A
Stringrepresenting a session ID if successful -
generateCustomerRecommendations(request:AsynchronoussessionID: ) Generates customer recommendations
Warning
This method is currently in beta and may change or be removed in future releases.Declaration
Swift
public func generateCustomerRecommendations( request: BTCustomerSessionRequest?, sessionID: String? ) async throws -> BTCustomerRecommendationsResultParameters
requestOptional. request type
BTCustomerSessionRequestsessionIDOptional. The shopper session ID
-
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.
Warning
This function is in beta. It’s public API may change or be removed in future releases.Declaration
Swift
public func sendPresentedEvent(for buttonType: BTButtonType, presentmentDetails: BTPresentmentDetails, sessionID: String)Parameters
buttonTypeType of button presented - PayPal, Venmo, or Other
presentmentDetailsDetailed 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.
sessionIDThe shopper session ID
-
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, sessionID: String)Parameters
buttonTypeType of button presented - PayPal, Venmo, or Other
sessionIDThe shopper session ID
-
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
View on GitHub