From 761c6ce0ab4db14ddede62cb61b6d6854dff7ea7 Mon Sep 17 00:00:00 2001 From: Zach Waterfield Date: Mon, 30 Sep 2024 18:38:48 -0400 Subject: [PATCH] chore: add credits cta dismissed report (#25288) --- frontend/src/scenes/billing/CreditCTAHero.tsx | 2 +- frontend/src/scenes/billing/PurchaseCreditsModal.tsx | 4 ++-- frontend/src/scenes/billing/billingLogic.tsx | 7 ++++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/frontend/src/scenes/billing/CreditCTAHero.tsx b/frontend/src/scenes/billing/CreditCTAHero.tsx index 12537275ac606..e2bf348d40cc9 100644 --- a/frontend/src/scenes/billing/CreditCTAHero.tsx +++ b/frontend/src/scenes/billing/CreditCTAHero.tsx @@ -116,7 +116,7 @@ export const CreditCTAHero = (): JSX.Element | null => { onClick={() => showPurchaseCreditsModal(true)} className="mt-4" > - Buy credits + Learn more {creditOverview.estimated_monthly_credit_amount_usd > 1 && ( <> diff --git a/frontend/src/scenes/billing/PurchaseCreditsModal.tsx b/frontend/src/scenes/billing/PurchaseCreditsModal.tsx index 3e1da2e330b9d..4907e2920d00d 100644 --- a/frontend/src/scenes/billing/PurchaseCreditsModal.tsx +++ b/frontend/src/scenes/billing/PurchaseCreditsModal.tsx @@ -145,10 +145,10 @@ export const PurchaseCreditsModal = (): JSX.Element | null => { text: creditInputValue >= 100000 ? ( <> - 30% off + 35% off ) : ( - '30% off' + '35% off' ), prefix: '$', value: 100000, diff --git a/frontend/src/scenes/billing/billingLogic.tsx b/frontend/src/scenes/billing/billingLogic.tsx index 80698633eed0a..8eae5896563c1 100644 --- a/frontend/src/scenes/billing/billingLogic.tsx +++ b/frontend/src/scenes/billing/billingLogic.tsx @@ -535,6 +535,11 @@ export const billingLogic = kea([ estimated_monthly_credit_amount_usd: creditOverview.estimated_monthly_credit_amount_usd, }) }, + toggleCreditCTAHeroDismissed: ({ isDismissed }) => { + if (isDismissed) { + posthog.capture('credits cta hero dismissed') + } + }, loadBillingSuccess: () => { if ( router.values.location.pathname.includes('/organization/billing') && @@ -635,7 +640,7 @@ export const billingLogic = kea([ const spend = +value let discount = 0 if (spend >= 100000) { - discount = 0.3 + discount = 0.35 } else if (spend >= 60000) { discount = 0.25 } else if (spend >= 20000) {