virling Pricing Self-host Demo Changelog Agencies GitHub Start free trial
integrations / revenuecat for ai apps

See which post, search or AI answer brings your subscribers on RevenueCat.

For founders of AI mobile apps who sell subscriptions through RevenueCat, often with a web paywall. Virling shows which channel brings the users who pay, for subscriptions and credit packs alike, including referrals from ChatGPT, Perplexity and other AI answers. Open source under AGPL, hosted or self-hosted.

Start free See the demo

People often meet an AI app in a ChatGPT answer, a post or a search, and land on your site before they subscribe. Virling joins a RevenueCat purchase to that visit when the purchase carries a visitor ID; the RevenueCat docs explain how. Below is what that means for an AI app in particular.

Web paywalls

A web paywall is where an AI app is easiest to credit: the buyer is already in a browser with the virling_vid cookie. Run the script on the paywall page, and have your server read the cookie and set it on the RevenueCat customer before checkout:

await fetch(`https://api.revenuecat.com/v2/projects/${projectId}/customers/${appUserId}/attributes`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.REVENUECAT_SECRET_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({ attributes: [{ name: "virling_vid", value: req.cookies.virling_vid }] }),
});

That call needs a key with write access to Customer information, separate from the one you give Virling. Check that the cookie is there before you send it. RevenueCat web paywall attribution walks through the paywall step in full.

Credits and usage plans

Many AI apps sell a subscription and top-up credit packs on the side. Both reach Virling through RevenueCat:

  • Credit packs. A pack bought as a non-renewing purchase arrives by webhook, in the currency paid, and adds revenue. Packs bought in the last 90 days are imported once when you connect.
  • Top-ups keep the first channel. Any purchase after a customer's first one keeps that first payment's channel, so a user who came from Perplexity and buys five packs adds all five to the AI channel.
  • Usage you meter yourself. Tokens, messages or generations counted in your own backend are not payments, so Virling does not see them. Only what RevenueCat charges counts.
  • Refunds. A cancellation by customer support, or with a negative price, marks the pack or subscription payment refunded.

The Channels card shows revenue per visitor for each channel, which tells you whether AI referrals bring heavy credit buyers or one-pack users.

Visits from AI answers

Visits referred by chatgpt.com, chat.openai.com, perplexity.ai, claude.ai, gemini.google.com, copilot.microsoft.com and chat.deepseek.com get the AI channel. When the referrer is missing, a utm_source such as chatgpt.com or perplexity still puts the visit in AI. A link from an assistant's app with neither usually lands in Direct.

Someone who reads an AI answer and goes straight to the App Store leaves no visit, so that subscriber counts toward revenue as Unattributed. The AI channel covers the people who clicked through to your site.

Trials on a chat app

A chat app often lets people try it free before the first charge. Set virling_vid before the trial starts, so the trial start carries the visitor ID. The trial start is kept apart and adds no revenue; the first paid renewal is credited through its own virling_vid, or else to the visit before the trial, and each renewal after it keeps that channel. The renewals rules have the details. RevenueCat product change events are not read, so a move from a weekly to a yearly plan counts only when RevenueCat also sends a purchase or renewal.

Set it up

Add the script to your site and paywall, set virling_vid as above, and paste a RevenueCat V2 secret key into Virling, which adds one webhook for purchases, renewals, non-renewing purchases and cancellations. The webhook needs Virling to be reachable over https; the hosted plan already is. Every setting is on the RevenueCat integration page, and Virling for mobile apps covers store purchases and web-to-app funnels for any app.

Open source

Virling is open source under AGPLv3, and the code is on GitHub. Use the hosted service, or self-host it as one binary with every feature. In a load test on 2026-10-31, in a container limited to one vCPU and 1 GB of RAM, it ingested 100,000 pageviews at 2,829 a second with none failed and a p99 of 34 ms, and used 157 MB of memory after the ingest.

Frequently asked questions

Are web paywall purchases credited automatically?

The paywall page must run the script, and virling_vid must be set on the RevenueCat customer before the purchase. Your server can read the virling_vid cookie from the request and set the attribute. A purchase without a visitor ID still counts toward revenue as Unattributed.

Are visits from ChatGPT and Perplexity tracked?

Yes, when they land on your site. Visits referred by chatgpt.com, chat.openai.com, perplexity.ai, claude.ai, gemini.google.com, copilot.microsoft.com and chat.deepseek.com get the AI channel. Someone who reads an AI answer and goes straight to the store leaves no visit to credit.

How are credit top-ups counted?

Each pack bought through RevenueCat adds revenue when it arrives by webhook. A later purchase by the same customer keeps the channel of their first payment, so top-ups add to the channel that brought the user.

Full guides: RevenueCat in the docs, Set up a mobile app and Renewals.

Start free