Integrations

Stripe

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.

How to connect Stripe

Here's the quickest way to connect Stripe to Bantico.

  1. Open API keys in Stripe.
  2. Create a restricted API key.
  3. Select "Providing this key for another website".
  4. Name it something like "Bantico".
  5. Add https://bantico.com as the allowed URL.
  6. Create the restricted key.
  7. Copy the generated API key.
  8. Open your Bantico project settings.
  9. Go to Integrations.
  10. Click connect for Stripe.
  11. Paste the restricted key.
  12. Click Connect.

After that, Bantico can start receiving Stripe payment outcomes and use them in attribution reporting.

Optional persist mode

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.

Replace YOUR_TOKEN with your Bantico project token.
index.html
<script  src="https://app.bantico.com/bantico.js"  data-token="YOUR_TOKEN"  data-persist></script>

How attribution works

When a Stripe payment event arrives, Bantico tries to resolve attribution in this order:

  1. Tracked link metadata
  2. Campaign and source context
  3. Email matching through identify

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.

Stripe Checkout metadata

When creating a Stripe Checkout session on your server, pass Bantico link and campaign context into metadata.

app/api/checkout/route.ts
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 });}

Email fallback with identify

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.

Troubleshooting

If Stripe payments are showing up but attribution looks wrong, check the following:

  1. You are passing Bantico metadata when creating the checkout session.
  2. The values match the same tracked link, campaign, source, or lead context you use in Bantico.
  3. Stripe is connected in your Bantico project settings.
  4. If you use persist mode, you only enable cookie-based tracking after consent for EU users.

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.