Introduction
DataFast is a revenue-first analytics tool that helps you discover which marketing channels drive paying customers. By integrating Dodo Payments with DataFast, you can attribute revenue to your traffic sources, identify high-value customer segments, and make data-driven decisions to grow your business.This integration requires your DataFast API Key, which you can obtain from your DataFast dashboard.
How It Works
DataFast tracks visitors through a unique visitor ID stored in a cookie. To attribute revenue to marketing channels, you need to:- Capture DataFast’s visitor ID from the
datafast_visitor_idcookie when creating checkout sessions - Store the visitor ID in your payment metadata
- Send payment data to DataFast when payments succeed using their Payment API
Getting Started
1
Install DataFast Script
First, install the DataFast tracking script on your website. This creates the
datafast_visitor_id cookie that tracks your visitors.Visit the DataFast documentation for installation instructions specific to your platform.2
Get Your API Key
Log in to your DataFast dashboard and navigate to your website settings to obtain your API key.
3
Capture Visitor ID in Checkout
When creating a checkout session, capture the DataFast visitor ID from the cookie and add it to your payment metadata.
4
Send Payment Data via Webhook
Configure a webhook to send payment data to DataFast’s Payment API when payments succeed.
5
Done!
🎉 Revenue data will now appear in your DataFast dashboard with full attribution to marketing channels.
Implementation Guide
Step 1: Add Visitor ID to Checkout Metadata
When creating a checkout session, capture the DataFast visitor ID from the cookie and include it in your payment metadata.Step 2: Send Payment Data to DataFast
Configure a webhook endpoint to send payment data to DataFast’s Payment API when payments succeed.1
Open the Webhook Section
In your Dodo Payments dashboard, navigate to Webhooks → + Add Endpoint and expand the integrations dropdown.

2
Select DataFast
Choose the DataFast integration card.
3
Enter API Key
Provide your DataFast API Key in the configuration field.

4
Configure Transformation
Edit the transformation code to format payment data for DataFast’s Payment API.
5
Test & Create
Test with sample payloads and click Create to activate the integration.
Transformation Code Examples
Basic Payment Attribution
basic_payment.js
Handle Zero Decimal Currencies
Some currencies (like JPY) don’t use decimal places. Adjust the amount calculation accordingly:zero_decimal.js
Subscription Payments
For recurring subscription payments, you can track each payment:subscription_payment.js
Best Practices
- Always include visitor ID in metadata: Without the visitor ID, DataFast cannot attribute revenue to marketing channels
- Handle zero decimal currencies: Some currencies (JPY, KRW, etc.) don’t use decimal places—adjust your amount calculation accordingly
- Test with sample payments: Verify the integration works correctly before going live
- Monitor your DataFast dashboard: Check that payments are appearing correctly with proper attribution
- Use webhook retries: DataFast’s Payment API is idempotent, so retries are safe if a webhook fails
Troubleshooting
Payments not appearing in DataFast
Payments not appearing in DataFast
- Verify your DataFast API key is correct and active
- Check that the
datafast_visitor_idis being captured and stored in payment metadata - Ensure the webhook transformation is correctly formatting the payload
- Verify the webhook is triggering on
payment.succeededevents - Check DataFast dashboard for any error messages or API logs
Revenue attribution not working
Revenue attribution not working
- Confirm the DataFast tracking script is installed and working on your website
- Verify the
datafast_visitor_idcookie is being set correctly - Check that visitor IDs match between checkout creation and payment completion
- Ensure you’re capturing the visitor ID before creating the checkout session
- Review DataFast’s Payment API documentation for additional guidance
Transformation errors
Transformation errors
- Validate the JSON structure matches DataFast’s Payment API format
- Check that all required fields (
amount,currency,transaction_id,datafast_visitor_id) are present - Ensure amount is correctly converted (divide by 100 for most currencies, except zero decimal currencies)
- Verify the API endpoint URL is correct:
https://datafa.st/api/v1/payments - Test the transformation with sample webhook payloads
Currency conversion issues
Currency conversion issues
- For zero decimal currencies (JPY, KRW, CLP, VND, UGX, MGA), send the amount as-is without dividing by 100
- For all other currencies, divide the amount by 100 to convert from cents to the base unit
- Double-check the currency code matches ISO 4217 format (e.g., “USD”, “EUR”, “JPY”)
Additional Resources
DataFast Documentation
Learn more about DataFast’s Payment API and revenue attribution features.
DataFast Dashboard
Access your DataFast dashboard to view revenue analytics and attribution data.
Need help? Contact Dodo Payments support at support@dodopayments.com for assistance with the integration.