DocsMeasure
Revenue and Stripe
Connect Stripe with a read-only key and see which sources pay.
1. Make a read-only key
- In Stripe, open Developers → API keys → Create restricted key.
- Name it “Dominion”. Set Read for Subscriptions, Invoices, Charges and Checkout Sessions. Leave everything else at None.
- Create the key and copy it. It starts with
rk_live_(orrk_test_in test mode). Secret keys (sk_) are refused.
2. Connect it
In your site, open Revenue → Connect Stripe and paste the key. Dominion checks that it can’t write and warns you if it can. The key is encrypted before it is stored, and only its last four characters are shown again.
3. Pass the visitor id to Checkout
To tie a payment to the source that brought the visitor, send the visitor id with the checkout. In the browser:
dominion.vid(function (vid) {
// today's visitor id, as soon as the first pageview has been counted
fetch('/create-checkout', { method: 'POST', body: JSON.stringify({ vid }) });
});dominion.vid() without a function returns the id straight away, or an empty string before the first pageview has been counted.
On your server, put it on the Checkout Session:
const session = await stripe.checkout.sessions.create({
mode: 'subscription',
line_items: [{ price: 'price_123', quantity: 1 }],
client_reference_id: vid,
metadata: { dominion_vid: vid },
subscription_data: { metadata: { dominion_vid: vid } },
success_url: 'https://example.com/thanks',
});Using a Payment Link? Add ?client_reference_id= and the id to the link’s address.
What you see
- Revenue per day, minus refunds, by channel and source.
- MRR: every active subscription turned into a monthly amount (a yearly plan counts a twelfth).
- New subscribers, trials, churn.
- Trial to paid counts only trials that have ended. A trial still running is undecided, never “unpaid”, so the rate isn’t dragged down by people who haven’t chosen yet.
- Revenue per visitor by channel and source, with ranges.
What attribution can’t do
The visitor id lives for one day (that is what keeps visitors private), so a payment is tied to a visit only when both happen on the same day. Payments without an id show as not attributed, and the page shows the share it could attribute. Dominion never copies your customers’ names or emails.