Attribute revenue with Dodo Payments

Before proceeding, confirm that you have installed the Flowsery Analytics tracking script.

1. Send the Flowsery Analytics visitor ID to Dodo Payments Checkout

Flowsery Analytics uses a cookie named _fs_vid to identify visitors. Include the value of this cookie in the checkout metadata when creating a Dodo Payments checkout session.

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: {
    _fs_vid: cookieStore.get('_fs_vid')?.value, // Passing Flowsery Analytics visitor ID to Dodo Payments
  },
  // ... other checkout session creation parameters
});

2. Obtain a Flowsery Analytics API key

Generate a Flowsery Analytics API key from your Website Settings. Navigate to Website Settings > API and click Create API Key.

Keep your API key private and never expose it in client-side code.

3. Set up a webhook in Dodo Payments

  1. In your Dodo Payments dashboard, go to Developer > Webhooks > Add endpoint

  2. Select Flowsery Analytics from the dropdown

  3. Enter your Flowsery Analytics API Key

  4. Click Create

Done!

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

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