Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get stripe data into google analytics #88

Open
BrunoSette opened this issue Oct 19, 2024 · 0 comments
Open

Get stripe data into google analytics #88

BrunoSette opened this issue Oct 19, 2024 · 0 comments

Comments

@BrunoSette
Copy link
Owner

https://docs.stripe.com/payments/checkout/analyze-conversion-funnel

O google analytics já está funcionado no site, só precisamos enviar para eles as informações de compra após a aprovação.

Acerdito que precisamos editar o arquivo stripe.ts

const session = await stripe.checkout.sessions.create({ payment_method_types: ["card"], line_items: [ { price: priceId, quantity: 1, }, ], mode: "subscription", success_url: ${process.env.BASE_URL}/api/stripe/checkout?session_id={CHECKOUT_SESSION_ID}, cancel_url: ${process.env.BASE_URL}/pricing, customer: team.stripeCustomerId || undefined, client_reference_id: user.id.toString(), allow_promotion_codes: true, subscription_data: { trial_period_days: 7, }, });

Especificamente o :

success_url: ${process.env.BASE_URL}/api/stripe/checkout?session_id={CHECKOUT_SESSION_ID},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant