All docs pages

Start

Quickstart

Install Referralmeter in one prompt, or by hand in four changes, and prove it tracks.

Referralmeter records affiliate clicks on your site, attributes signups, and turns the payments your billing provider reports into commissions. Installing it is three small code changes and one billing connection. A coding agent can do all of it from one prompt, then prove it works.

The fast way: one prompt

  1. Create your program and open Install & verify in the dashboard.
  2. Pick your coding agent (Claude Code, Cursor, Lovable or another), click Create key and add it, and copy the prompt.
  3. Paste it into the agent, in your app's folder. It adds the script, the signup call and the checkout metadata, tells you how to connect billing, and starts a verification.
  4. Open the test link it gives you, sign up, and pay in test mode. When every step arrives, the run passes and you get a public install certificate.

Prefer tools to a prompt? Connect the MCP server and ask your agent to "install Referralmeter and verify it". The full procedure for agents is also at /agents/install.md.

By hand

1. Add the tracking script

Put it in <head> of every public page. Your public key (pk_…) is on Install & verify; it is safe in the browser.

<script src="https://referralmeter.com/t.js" data-key="pk_…" async></script>

Script reference

2. Report signups

Right after an account is created:

window.referralmeter?.signup(user.email, { uid: user.id });

3. Pass the referral into checkout

// Browser: read the referral and send it to the endpoint that creates the Checkout Session.
const ref = window.referralmeter?.ref() ?? null;

// Server, in stripe.checkout.sessions.create({...}):
client_reference_id: ref ?? undefined,
metadata: { referralmeter_ref: ref ?? "" },
subscription_data: { metadata: { referralmeter_ref: ref ?? "" } }, // subscriptions only

// Payment Links, the pricing table and Buy Buttons need no code: the script adds client_reference_id itself.

That is Stripe. The other providers take the same value under their own custom-data field: Polar, Lemon Squeezy, Paddle, Creem, Dodo Payments. Billing we don't connect to natively reports sales with the REST API.

4. Connect billing

Open Billing connections in the dashboard and follow the steps for your provider. Payments reach Referralmeter through the provider's signed webhooks, so attribution survives ad blockers.

5. Verify

Install & verify → Start verification. You get a test link. Open it, sign up, pay with a test card. Each step turns orange as our servers see it. How verification works.