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.
- Open Dodo Payments API keys.
- Create a new API key for Bantico.
- Name it something like
Bantico. - Copy the generated key.
- Open your Bantico project settings.
- Go to Integrations.
- Click Connect for Dodo Payments.
- Paste the API key.
- Save the integration.
After that, Bantico can start using Dodo Payments outcomes in your attribution reporting.
Consent-gated loading
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.
data-persist flag in the current Bantico loader. Use the normal Bantico script and gate when you load it.<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.
- Dodo Payments metadata
- Tracked-link and campaign context already present on the session
- 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.
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:
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:
- You pass Bantico metadata when creating the payment.
- The metadata values match the same tracked link, campaign, source, medium, content, and lead context used elsewhere in Bantico.
- Dodo Payments is connected in your Bantico project settings.
- If you use consent-gated loading, Bantico only loads after consent.
- 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.