FauryaFaurya
Revenue Attribution

Dodo Payments

Set up revenue attribution with Dodo Payments. Capture visitor ID in checkout metadata and send payment data to Faurya via webhook.

Attribute revenue with Dodo Payments

Make sure you've installed the Faurya tracking script first.

1. Pass the Faurya visitor ID to Dodo Payments Checkout

Faurya uses a simple cookie named Faurya_visitor_id to track visitors. Send the value of this cookie to the checkout metadata when creating a checkout session in Dodo Payments.

import { cookies } from "next/headers";
import { dodopayments } from "@/lib/dodopayments";

const cookieStore = await cookies();

const checkoutSession = await dodopayments.checkoutSessions.create({
  product_cart: [
    {
      product_id: productId,
      quantity: 1,
    },
  ],
  metadata: {
    faurya_visitor_id: cookieStore.get("faurya_visitor_id")?.value, // Passing Faurya's visitor ID to Dodo Payments
  },
  // ... other checkout session creation parameters
});

2. Copy this webhook url from revenue settings

Image coming soon

Faurya tracking traffic sources

3. Create webhook in Dodo Payments

  1. In your Dodo Payments dashboard, navigate to Developer → Webhooks → Add endpoint
  2. Paste the copied webhook url
  3. select all events

Image coming soon

Select Faurya integration in Dodo Payments

  1. Click Create

4. Paste the webhook secret in Faurya

Image coming soon

Faurya tracking traffic sources

Done!

Revenue data will now appear in your Faurya dashboard with full attribution to marketing channels.

After receiving a successful payment, you should see revenue data in your dashboard (referrer, country, browser, etc.).

On this page