Polar
Connect Polar so Bantico can attribute completed payments back to the tracked link, campaign, source, medium, content, and lead that drove the customer.
The strongest Polar attribution comes from passing Bantico context directly into checkout metadata. That means sending fields like linkId, campaignId, source, medium, content, and leadId.
How to connect Polar
Here's the quickest way to connect Polar to Bantico.
- Open Polar access tokens.
- Create a new access token for Bantico.
- Name it something like
Bantico. - Copy the generated token.
- Open your Bantico project settings.
- Go to Integrations.
- Click Connect for Polar.
- Paste the access token.
- Save the integration.
After that, Bantico can start using Polar payment 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 Polar payment arrives, Bantico tries to resolve attribution using the strongest available context.
- Polar checkout 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 Polar checkout metadata when you create the checkout session.
Polar checkout metadata
When creating a Polar checkout on your server, pass Bantico attribution context into metadata.
import { Polar } from "@polar-sh/sdk"; const polar = new Polar({ accessToken: process.env.POLAR_ACCESS_TOKEN! }); export async function POST(request: Request) { const { productId, bantico } = await request.json(); const checkout = await polar.checkouts.create({ product_id: productId, success_url: "https://yourapp.com/success", metadata: { linkId: bantico?.linkId || "", campaignId: bantico?.campaignId || "", source: bantico?.source || "", medium: bantico?.medium || "", content: bantico?.content || "", leadId: bantico?.leadId || "", }, }); return Response.json({ url: checkout.url });}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 checkout 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 Polar checkout metadata is still the preferred setup. Identify-based fallback is helpful, but it should not replace proper checkout metadata.
Learn more about identifying users.
Troubleshooting
If Polar payments are showing up but attribution looks wrong, check the following:
- You pass Bantico metadata when creating the checkout session.
- The metadata values match the same tracked link, campaign, source, medium, content, and lead context used elsewhere in Bantico.
- Polar 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 Polar on the server.
If everything looks correct and attribution is still off, contact support with an example checkout or payment so it's easier to debug.