Revenue Attribution
Trackflow automatically tracks and attributes your revenue to the right marketing channels.
1. Connect your Payment Provider
Go to your website settings in Trackflow and follow the instructions to connect your Stripe account.
2. Pass Metadata during Checkout
Pass metadata with trackflow_visitor_id and trackflow_session_id (cookies from Trackflow) when creating a checkout session:
// app/api/create-checkout/route.js
import { cookies } from 'next/headers';
const session = await stripe.checkout.sessions.create({
line_items: [...],
mode: 'payment',
metadata: {
trackflow_visitor_id: cookies().get('trackflow_visitor_id')?.value || '',
trackflow_session_id: cookies().get('trackflow_session_id')?.value || ''
},
});
Trackflow automatically tracks revenue when these metadata fields are present in your Stripe checkout sessions.
How It Works
Trackflow uses two cookies to track revenue attribution:
trackflow_visitor_id
- Identifies unique visitorstrackflow_session_id
- Tracks the current session
Testing
To verify your implementation:
- Create a test checkout session in Stripe
- Verify the metadata contains both Trackflow IDs
- Complete a test purchase
- Check your dashboard for the attributed revenue
Need more help?
Can't find what you're looking for in our documentation? Our support team is here to help you.