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 connected your DodoPayments account 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
});

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.).