Lovable builds a real React app from your prompts, so the tracking snippet is just
another line in index.html. Ask Lovable's AI to add it, or paste it
yourself if you've got Dev Mode or GitHub sync switched on — either way Qanary
starts tracking through to your checkout, keeping the ?via= links your
affiliates already share.
ask lovable: "add this script tag to the <head> of index.html." that's the whole install.
However you're tracking referrals in a Lovable app today — a spreadsheet, a generic pixel, or nothing yet — attribution needs to survive ad blockers, the commission math needs to survive an audit, and the payout needs to go out on a rail you already use. Here's what one script tag adds:
Basic click tracking at best — no coupon-code fallback for ad blockers or podcasts, no fraud check before a commission is owed, and payouts mean a manual spreadsheet.
One script tag in index.html. Coupon-code fallback, fraud checks
before commission, and payouts through Wise or PayPal — the same system whether
you're on Lovable or anywhere else.
1. Paste the tracking snippet — open Lovable's chat and ask:
"Add this script tag to the <head> of index.html." Lovable's
AI edits the file for you. If you've got GitHub sync or Dev Mode on, you can
paste it directly instead.
2. Carry the referral into checkout — wherever your app kicks
off Stripe Checkout (an edge function, a Supabase function, or an API call you
asked Lovable to build), read Qanary.checkoutStamp() client-side
and send stamp.ref into client_reference_id.
3. Verify — open your app with a test ?via=, run
a test-mode checkout, and confirm the conversion lands attributed — or ask
your coding agent to run the MCP diagnose_attribution tool.
<script src="https://app.qanary.cloud/qanary.js" data-qanary="YOUR_PROGRAM_SLUG" async></script>
Ask Lovable's AI to paste this exact tag into
index.html's <head>, or add it yourself via Dev
Mode or GitHub sync. Swap YOUR_PROGRAM_SLUG for the program slug
from your Qanary dashboard.
Reads ?via=AFFILIATE_CODE off the URL the moment a visitor lands
and records the touchpoint — no configuration beyond the program slug.
Feeds stamp.ref into whatever call kicks off Stripe Checkout — an
edge function, a Supabase call, or a workflow you asked Lovable to build — so a
sale still traces back to the right affiliate.
Ask your coding agent to run diagnose_attribution and it walks
visit → identify → webhook → attribution → ledger, so a stalled conversion is
never a mystery.
The most common shape: a Supabase edge function calls Stripe Checkout server-side. The snippet's stamp feeds straight into that call.
Gated content behind Supabase auth rules — the snippet in index.html keeps attributing independent of the access logic.
A Lovable marketing site linking out to a separate app for checkout. Keep ?via= on the links and the cookie carries the referral across.
Swap the old tracking snippet for Qanary's in index.html — existing ?via= links your affiliates already shared keep working.
| Capability | Tracking it yourself | Qanary |
|---|---|---|
| Setup time on Lovable | Custom dev project | ~10 minutes |
| Coupon-code fallback for ad blockers | No | Yes |
| Fraud checked before commission is owed | No | Yes |
| Falls back with no page to instrument | No | Yes, via coupon codes |
async,
so it never blocks page rendering while it sets the attribution cookie.
?via= link.
index.html's <head>. Ask Lovable's chat to add it for you, or paste it directly if you have Dev Mode or GitHub sync switched on.
No — it loads with the async attribute, so it fetches in the
background and never blocks page rendering.
Read Qanary.checkoutStamp() wherever your app calls Stripe Checkout — an edge function, a Supabase call, or an API route — and send stamp.ref into client_reference_id.
The snippet lives in index.html, which Lovable rarely touches when it's iterating on components. If you ask it to rebuild index.html specifically, just ask it to keep the Qanary script tag in place.
Yes — Lovable's own chat can paste the snippet directly. If you're also using Claude Code, Cursor, or Codex against the exported repo, point it at Qanary's llms.txt and it can wire the webhook too.
Join the waitlist now; when registration opens, wire your Lovable app in ten minutes.
Join the waitlist