Shopper Insights (Beta)

OverviewAnchorIcon

Use Shopper Insights to optimize your checkout experience by prioritizing the customer’s preferred payment methods in your UI. Customizing the checkout experience can improve conversion, increase repeat buys and boost user retention.

IntegrationAnchorIcon

The getRecommendedPaymentMethods method returns PayPal or Venmo as recommended payment using their email.

Before using this method, obtain consent from the customer to share this information with PayPal services.

Use the following code snippet to get the recommended payment methods and adjust your UI/UX accordingly. Add the following in your app-level build.gradle:
  1. Kotlin
  2. Java
val apiClient = BraintreeClient("CLIENT_TOKEN")
val shopperInsightsClient = ShopperInsightsClient(apiClient)
val shopperInsightsRequest = ShopperInsightsRequest(email = "fake-email@email.com")

shopperInsightsClient.getRecommendedPaymentMethods(shopperInsightsRequest) { result ->
    when (result) {
        is ShopperInsightsResult.Success -> {
            if (result.response.isPayPalRecommended) {
                // PayPal was recommended
            } else if (result.response.isVenmoRecommended) {
                // Venmo was recommended
            }
        }
        is ShopperInsightsResult.Failure -> {
            // handle error
        }
    }
}