Show each client which channel brought their Stripe revenue.
For agencies and freelancers whose clients sell through Stripe, from SaaS subscriptions to Payment Links. Virling reads each client's Stripe account with a read-only restricted key, credits every payment to the channel and campaign of the visit before it, and keeps renewals on the channel that won the customer. Open source under AGPL, hosted or self-hosted.
Stripe knows who paid and how much, but not which ad, email or post sent the customer. Virling joins each payment to the visit before it, one client at a time, through a visitor ID passed into the client's checkout. For clients with a Shopify store, see Shopify agency client reporting.
Restricted key, not secret key
Virling refuses secret keys, the ones that start with sk_live_ or sk_test_, because they can write. It asks for a restricted key that starts with rk_live_, or rk_test_ in test mode, with Read on Charges, Checkout Sessions, Customers, Events, Invoices, Subscriptions and PaymentIntents, and None on everything else. If the key cannot read Charges or PaymentIntents, connecting fails with a message listing what is missing.
The client creates the key, or someone on their Stripe team who is allowed to manage API keys, under Developers, API keys, Create restricted key. Name it after your agency, so the client can find and delete it when you part ways. If you already have a seat on the client's Stripe team with that permission, you can create it yourself, but it still belongs to their account.
Clients with several Stripe accounts
A site holds one Stripe connection. A client who runs separate Stripe accounts, for example one per brand, needs one site per account, each on the domain whose checkout uses that account, all under the same client name. All clients then shows each site's visitors and revenue over the last 30 days, with a total for the client.
Two Stripe accounts behind one domain cannot both report into its site, so ask early which account each checkout uses. Customers are matched by Stripe customer ID, so someone who pays through two accounts counts as two customers. Test payments made with an rk_test_ key also stay in the reports after you replace it with a live key, so test on a staging domain with its own site if the client's history should start clean.
Tie every client's Stripe payments to a channel
For agencies whose clients take payment through Stripe. Virling is open source under AGPL: self-host it free, or use the hosted version with a 14-day free trial.
Pass the visitor ID into checkout
Virling looks for the visitor ID in metadata.virling_vid on the charge, then on the Checkout Session that created it, where client_reference_id works too, then on its PaymentIntent. For the client's developer that is one line: client_reference_id from the virling_vid cookie on a Checkout Session, or metadata.virling_vid on a PaymentIntent for Elements. If the client already uses client_reference_id for their own IDs, set the session's metadata.virling_vid, which is read first.
Payment Links on buy.stripe.com need no developer. The script adds the visitor ID as client_reference_id to each such link on a page it runs on, unless the link already has one. A link on a custom domain, or one opened from an email, a QR code or another site, carries no visitor ID and shows as Unattributed, so link to Payment Links from the client's own pages where you can. See Stripe Payment Link UTM tracking.
Subscriptions and renewals in the monthly report
A charge whose invoice has billing reason subscription_cycle or subscription_update, and any later charge of the same Stripe customer, keeps the channel of that customer's first payment. Payments splits the range into From new customers and From renewals, so for a monthly review the client sees what new marketing brought apart from what earlier subscribers keep paying.
Renewals of subscriptions that started before the 90-day first import are usually Unattributed, because their first payment is not in Virling. They stay that way, so the Unattributed share falls only as customers tracked from their first payment make up more of the revenue. Say so in the first few reports.
Retention reads each Stripe subscription's status once an hour and counts active, trialing and past_due ones as live, so it shows which channels bring subscribers who stay, and MRR shows on Latest payments. A free trial started through Checkout after you connect credits its first charge to the visit before the trial. Refunds and lost disputes after you connect update the payments they belong to. The client marketing report template puts these numbers in the order clients read them.
Set up a client
- Add the site. Click + Add a site, enter the client's domain and timezone, and set their name under Client in site settings.
- Install the script. Paste the site's tag from its setup screen before
</head>on every page of the client's site. Each client gets its own tag, becausedata-sitemust match the domain you added. - Connect Stripe. Paste the restricted key into the site's payment setup and click Connect and backfill. Charges from the last 90 days come in, then new payments every minute.
- Wire up checkout. Add the visitor ID to Checkout Sessions or PaymentIntents, or check that Payment Links sit on pages that run the script. See the Stripe integration and how to track Stripe revenue by traffic source.
- Check, then share. Make one payment from a tagged visit and check that it shows a channel in Payments. Then add your branding under Client report and send the client link.
When the engagement ends
Save the report with Download PDF, or pull payments as JSON through the Read API. Disconnect in site settings deletes the stored key and stops syncing, and payments already imported stay. Ask the client to delete the restricted key in their Stripe Dashboard too, take out the tag and the checkout line, and revoke the client link and weekly email. An API key reads every client site and cannot be limited to one, so revoke any key you shared.
Open source
Virling is open source under AGPLv3, and the code is on GitHub. Use the hosted service, or self-host it on your own server with every feature if a client needs their data kept in house. In a load test on 2026-10-31, limited to one vCPU and 1 GB of RAM, Virling ingested 100,000 pageviews at 2,829 a second with none failed and a p99 of 34 ms. How it was measured.
Frequently asked questions
How do agencies show clients which channel brought their Stripe revenue?
Give each client a Virling site, put its script on their pages, connect their Stripe account with a read-only restricted key, and add the visitor ID to their checkout. Virling credits every charge to the visit before it, and every renewal to the channel of the first payment, and the client reads the result from a branded link without a login.
Can one client site connect two Stripe accounts?
No. A site holds one Stripe connection. Put each Stripe account on its own site, on the domain whose checkout uses that account, and give the sites the same client name so All clients adds them up.
Can Virling change anything in a client's Stripe account?
No. Virling only accepts a restricted key with read access and refuses secret keys. It never creates, changes or refunds anything. When the engagement ends, Disconnect deletes the stored key.
What if the client uses Stripe Payment Links?
Payment Links on buy.stripe.com need no code. When a visitor clicks one on a page that runs the script, the script adds the visitor ID as client_reference_id, and Stripe copies it onto the Checkout Session.
Who can see which client?
Team members on your account see and manage every client site, and an API key reads every site too, so keep both for your own staff. A client link opens only that client's site report. Do not invite a client as a team member.
How many months of Stripe payments load at the start?
About three. The first import reads charges from the last 90 days, then new payments every minute. Charges from before the script was on the client's site count as revenue but are Unattributed, and so are later renewals of those subscriptions.
Full guide: Run Virling for client sites and Stripe in the docs.