Stripe

Connect Stripe to DataSaaS to see which marketing channels generate actual revenue.

Connecting Stripe

1

Open Revenue settings

Go to Dashboard → Settings → Revenue.

2

Select Stripe

Choose Stripe as your payment provider.

3

Enter your API key

Enter your Stripe Secret Key (starts with sk_live_ or sk_test_).

4

Connect

Click Connect. DataSaaS will fetch your transactions and match them to visitors.

Stripe Checkout API

Pass the DataSaaS visitor ID as a client_reference_id when creating a Checkout Session:

javascript
const session = await stripe.checkout.sessions.create({
  client_reference_id: visitorId, // datasaas_visitor_id
  line_items: [{ price: 'price_xxx', quantity: 1 }],
  mode: 'payment',
  success_url: 'https://yourdomain.com/success',
  cancel_url: 'https://yourdomain.com/cancel',
})

The DataSaaS tracking script automatically appends the client_reference_id parameter to Stripe Payment Links. No extra code needed — just use your Stripe Payment Links as normal.

Stripe PaymentIntent API

For custom payment flows using the PaymentIntent API, pass the visitor ID in metadata:

javascript
const paymentIntent = await stripe.paymentIntents.create({
  amount: 4999,
  currency: 'usd',
  metadata: {
    datasaas_visitor_id: visitorId,
  },
})