Bantico logo
Docs
Integrations

Dodo Payments

Connect Dodo Payments so Bantico can attribute completed payments back to the tracked link, campaign, source, medium, content, and lead that drove the customer.

The strongest Dodo Payments attribution comes from passing Bantico context directly into payment metadata. That means sending fields like linkId, campaignId, source, medium, content, and leadId.

How to connect Dodo Payments

Here's the quickest way to connect Dodo Payments to Bantico.

  1. Open Dodo Payments API keys.
  2. Create a new API key for Bantico.
  3. Name it something like Bantico.
  4. Copy the generated key.
  5. Open your Bantico project settings.
  6. Go to Integrations.
  7. Click Connect for Dodo Payments.
  8. Paste the API key.
  9. Save the integration.

After that, Bantico can start using Dodo Payments outcomes in your attribution reporting.

Bantico uses visitor and session cookies to persist attribution on the same site. If you need consent-first behavior for EU users, only load Bantico after consent is granted.

There is no separate data-persist flag in the current Bantico loader. Use the normal Bantico script and gate when you load it.
index.html
<script>  window.BANTICO_TOKEN = "YOUR_TOKEN";</script><script src="https://app.bantico.com/bantico.js"></script>

How attribution works

When a Dodo payment arrives, Bantico tries to resolve attribution using the strongest available context.

  1. Dodo Payments metadata
  2. Tracked-link and campaign context already present on the session
  3. Identified user data such as email, if available

The most reliable setup is always sending Bantico context directly into Dodo payment metadata when you create the payment session.

Dodo Payments metadata

When creating a Dodo payment on your server, pass Bantico attribution context into metadata.

app/api/checkout/route.ts
import DodoPayments from "dodopayments"; const dodo = new DodoPayments(process.env.DODO_API_KEY!); export async function POST(request: Request) {  const { productId, bantico } = await request.json();   const payment = await dodo.payments.create({    billing_currency: "USD",    product_cart: [{ product_id: productId, quantity: 1 }],    success_url: "https://yourapp.com/success",    cancel_url: "https://yourapp.com/pricing",    metadata: {      linkId: bantico?.linkId || "",      campaignId: bantico?.campaignId || "",      source: bantico?.source || "",      medium: bantico?.medium || "",      content: bantico?.content || "",      leadId: bantico?.leadId || "",    },  });   return Response.json({ url: payment.payment_link });}

These metadata fields should match the same Bantico context you use in tracked links and events: linkId, campaignId, source, medium, content, and leadId.

Email fallback with identify

If a payment is missing full link metadata, Bantico can still use identified user data as fallback context.

Call bantico.identify() when the user signs in or becomes known:

app/page.tsx
bantico.identify({  id: "user_123",  email: "jane@example.com",  name: "Jane Smith",});

Direct Dodo payment metadata is still the preferred setup. Identify-based fallback is helpful, but it should not replace proper payment metadata.

Learn more about identifying users.

Troubleshooting

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

  1. You pass Bantico metadata when creating the payment.
  2. The metadata values match the same tracked link, campaign, source, medium, content, and lead context used elsewhere in Bantico.
  3. Dodo Payments is connected in your Bantico project settings.
  4. If you use consent-gated loading, Bantico only loads after consent.
  5. Your checkout flow actually sends the metadata to Dodo Payments on the server.

If everything looks correct and attribution is still off, contact support with an example payment so it's easier to debug.