Dodo Payments revenue attribution
Tie paid Dodo Payments customers back to the campaign that brought them in.
Two steps: connect your Dodo Payments API key in Piqo, then pass the piqo_visitor cookie as checkout metadata. A background sync pulls succeeded payments every minute and records each one against the visitor's pageviews.
1. Connect Dodo Payments in Piqo
In your site's Settings → Dodo Payments, paste a live API key (Dodo dashboard → Developer → API Keys).
2. Pass the visitor id into checkout
On your server, attach the visitor id to the checkout session's metadata:
// Node — wherever you create the Dodo checkout session
const session = await dodo.checkoutSessions.create({
product_cart: [{ product_id: '<your_product_id>', quantity: 1 }],
return_url: 'https://yoursite.com/thanks',
metadata: {
piqo_visitor_id: req.cookies.piqo_visitor, // your own visitor id
piqo_session_id: req.cookies.piqo_session, // optional
},
});What you'll see
Within a minute, the payment shows up on your dashboard's Conversions page with the channel / country / UTM columns from the matching pageview, and its revenue lands on the chart. Payments without the metadata still count toward revenue totals — they just show as Direct.
Where does the visitor id come from? Keep your own — generate a UUID on first pageview, store it in a first-party cookie, and pass that string. Any opaque, stable token works.