Connect Stripe so Bantico can attribute completed payments back to the tracked link, campaign, source, and lead that drove the customer.
For the strongest attribution, pass Bantico link and campaign context into Stripe checkout metadata. If you also use persist mode, make sure EU users only enter cookie-based tracking after consent. Learn more.
Here's the quickest way to connect Stripe to Bantico.
After that, Bantico can start receiving Stripe payment outcomes and use them in attribution reporting.
Persist mode is optional for Stripe attribution, but it can help maintain session continuity on the same site. If you use cookie-based tracking, only enable it after consent for EU users.
YOUR_TOKEN with your Bantico project token.<script src="https://app.bantico.com/bantico.js" data-token="YOUR_TOKEN" data-persist></script>When a Stripe payment event arrives, Bantico tries to resolve attribution in this order:
The strongest option is always passing Bantico metadata directly into the Stripe checkout session. If that is missing, Bantico can still use other context or fall back to an identified email when available.
When creating a Stripe Checkout session on your server, pass Bantico link and campaign context into metadata.
import Stripe from "stripe";const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!);export async function POST(request: Request) { const { linkId, campaignId, source, medium, content, leadId } = await request.json(); const session = await stripe.checkout.sessions.create({ line_items: [{ price: "price_xxx", quantity: 1 }], mode: "payment", success_url: "https://yourapp.com/success", cancel_url: "https://yourapp.com/pricing", metadata: { linkId, campaignId, source, medium, content, leadId }, }); return Response.json({ url: session.url });}If some checkouts happen without full link metadata, Bantico can still attempt attribution by matching the Stripe customer email to an identified profile.
Call bantico.identify()with the user's email when they sign in:
bantico.identify({ id: "user_123", name: "Jane Smith", email: "jane@example.com",})When Stripe sends a payment event without full Bantico metadata, Bantico can look up the customer email and try to match it to an identified profile. This is useful as a fallback, but direct metadata is still the preferred option.
Learn more about identifying users.
If Stripe payments are showing up but attribution looks wrong, check the following:
If everything looks correct and attribution is still off, contact support and include an example checkout or payment event so it's easier to debug.