Integration
Dodo Payments analytics: see which channel your buyers came from
Dodo Payments records the sale. Peregrine records which channel found the buyer, in the amount you were actually paid. Paste one read-only key and each payment is credited to the visit that first brought that customer.
How it connects
- Add the Peregrine tag to your site. Dodo Payments links are stamped with the visitor’s id automatically.
- In Dodo Payments, create an API key with write access switched off and paste it into Peregrine. A test-mode key works too, against test payments.
- Pick which brand this site is. A key belongs to a business, and a business can run several brands, so Peregrine asks rather than guessing.
How a sale is credited
The tag adds your visitor’s id to the payment link as metadata_reference_id, which comes back on the payment as metadata.reference_id.
If you create Dodo Payments checkout sessions through the API, read the peregrine_vid cookie from the request and pass it as metadata.reference_id. If the cookie is missing, create the session as before.
import { cookies } from 'next/headers';
const visitor = (await cookies()).get('peregrine_vid')?.value;
// when you create the checkout session:
metadata: { reference_id: visitor }What you see
- Which channel sent the most visitors, beside which channel earned the most money.
- The settlement amount, not the charged one. Dodo Payments can charge a buyer in their own currency, and its payment list shows only that. Peregrine looks the settlement amount up for each payment, so a $3 product bought in shekels reads $3, not the local price.
- Only succeeded payments that have not been refunded. Your last 30 days are read on the first sync and show as unattributed, since they predate the tag.
What to know
- The key only needs to list brands and read payments, so make it read-only. It is stored encrypted.
- Payments are read when you open the dashboard; there is no webhook to set up.
- Verified end to end with real payments, in test mode and live.
Questions
How do I see which channel my Dodo Payments customers came from?
Add the Peregrine tag to your site and paste a read-only Dodo Payments API key. The tag adds the visitor’s id to your payment link, it comes back as metadata.reference_id, and Peregrine credits the sale to that visitor’s first visit.
Which Dodo Payments API key permissions does it need?
Read access only. Create the key with write access switched off. A test-mode key works against test payments.
Why does Peregrine show the settlement amount?
Dodo Payments can charge a buyer in their own currency, and its payment list shows only that. Peregrine looks up the settlement amount for each payment, so what you see is what you were paid.
I run several brands. Which one is counted?
Only the brand you pick after pasting the key. A key belongs to a business, and a business can run several brands.
Do I need a Dodo Payments webhook?
No. Peregrine reads your payments when you open the dashboard.