Skip to content

Commit

Permalink
Fix missing analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahkoop committed Dec 16, 2024
1 parent 543fd50 commit 3959200
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ class ShopperInsightsClient internal constructor(
analyticsParamRepository.resetSessionId()
braintreeClient.sendAnalyticsEvent(
GET_RECOMMENDED_PAYMENTS_STARTED,
AnalyticsEventParams(experiment = experiment)
AnalyticsEventParams(
experiment = experiment,
shopperSessionId = shopperSessionId
)
)

if (request.email == null && request.phone == null) {
Expand Down Expand Up @@ -141,7 +144,7 @@ class ShopperInsightsClient internal constructor(
callback: ShopperInsightsCallback,
error: Exception
) {
braintreeClient.sendAnalyticsEvent(GET_RECOMMENDED_PAYMENTS_FAILED, analyticsEventParams)
braintreeClient.sendAnalyticsEvent(GET_RECOMMENDED_PAYMENTS_FAILED, analyticsParams)
callback.onResult(ShopperInsightsResult.Failure(error))
}

Expand All @@ -151,7 +154,7 @@ class ShopperInsightsClient internal constructor(
isPayPalRecommended: Boolean,
isVenmoRecommended: Boolean,
) {
braintreeClient.sendAnalyticsEvent(GET_RECOMMENDED_PAYMENTS_SUCCEEDED, analyticsEventParams)
braintreeClient.sendAnalyticsEvent(GET_RECOMMENDED_PAYMENTS_SUCCEEDED, analyticsParams)
callback.onResult(
ShopperInsightsResult.Success(
ShopperInsightsInfo(
Expand Down Expand Up @@ -190,7 +193,7 @@ class ShopperInsightsClient internal constructor(
* This method sends analytics to help improve the Shopper Insights feature experience.
*/
fun sendPayPalSelectedEvent() {
braintreeClient.sendAnalyticsEvent(PAYPAL_SELECTED, analyticsEventParams)
braintreeClient.sendAnalyticsEvent(PAYPAL_SELECTED, analyticsParams)
}

/**
Expand Down Expand Up @@ -220,7 +223,7 @@ class ShopperInsightsClient internal constructor(
* This method sends analytics to help improve the Shopper Insights feature experience.
*/
fun sendVenmoSelectedEvent() {
braintreeClient.sendAnalyticsEvent(VENMO_SELECTED, analyticsEventParams)
braintreeClient.sendAnalyticsEvent(VENMO_SELECTED, analyticsParams)
}

/**
Expand All @@ -237,7 +240,7 @@ class ShopperInsightsClient internal constructor(
return deviceInspector.isVenmoInstalled(context)
}

private val analyticsEventParams : AnalyticsEventParams get() {
private val analyticsParams : AnalyticsEventParams get() {
return AnalyticsEventParams(shopperSessionId = shopperSessionId)
}

Expand Down

0 comments on commit 3959200

Please sign in to comment.