Skip to main content
Rally pays creators for the customers they bring. For that, a referral has to survive the trip from a creator’s link to your signup and your billing. Three pieces make it work; the first is required, the other two depend on how you take payment.
Settings → Tracking in Rally writes all of this for your stack, with your keys filled in, and a single prompt you can paste into Cursor, Claude Code or Codex to do the whole integration. This page is the same material, for reading.

Before you start

1

Pick your stack

Under Settings → Tracking → Stack, select everything that applies: frontend (React, Next.js, plain HTML, Webflow, Framer, WordPress, Shopify), billing (Stripe Checkout, Stripe Payment Links) and backend (Node.js, Python, Go). The page then shows only the steps and code you need. Sites with no backend report signups from the browser; sites with one report them from the server.
2

Add your allowed hostnames

Under Allowed hostnames, add every domain where signups can be reported (example.com; subdomains are included). The publishable key below is public, so the hostname list is what stops another site from writing referrals into your account.
3

Where links send people

Under Where links send people, confirm the default landing page and add others if creators or ads should be able to send people to pricing or a feature page. Each destination carries its own UTM defaults; {{creator}}, {{content}} and {{campaign}} are filled in per link.
4

If you have a backend: create an API key

Click Create next to Backend API key (or use Settings → API keys with the attribution:write scope). Store it as RALLY_API_KEY in your server’s secret store. Never put it in the client bundle.

1. Install the snippet

Add the tag to every page a creator’s link can land on. Your tag, with your publishable key, is under Settings → Tracking → Add the snippet.
When a visitor arrives from a creator’s link (?ref=a_…&via=CODE, added by Rally’s redirect), the snippet:
  • stores rally_ref and rally_via as first-party cookies on your registrable domain (example.com), so app.example.com sees a referral that landed on example.com, for the program’s attribution window (90 days by default);
  • exposes window.rally.ref(), window.rally.via() and window.rally.lead();
  • rewrites any buy.stripe.com or checkout.stripe.com link on the page to carry client_reference_id=<ref>, so Payment Links attribute with no further work.
  • data-cookie-domain="example.com": where the cookie is set. Rally finds your registrable domain on its own; set this only if that guess is wrong.
  • data-cookie-days="60": a shorter or longer attribution window than the program’s default.
At least on the site creator links land on, usually the marketing site. Because the cookie is set on the registrable domain, an app on a subdomain reads it without its own copy of the snippet. Installing it on both is fine.
No. It identifies your workspace and is safe in the browser. Anything that writes is also checked against your allowed hostnames. You can rotate it under Settings → Tracking → Rotate key; the old key stops working at once, so update the tag at the same time.

2. Report signups

A signup (a lead) ties your own stable user id to the referring creator. Report it once, when the account is created. Later sales attribute through that id on their own. Clicks need nothing: Rally records them when the visitor follows the link.
Right after a successful signup, on a page that knows the new user’s id and is on an allowed hostname:

3. Report sales

1

Connect the webhook

Settings → Integrations → Stripe: copy the endpoint URL Rally shows into your Stripe dashboard (Developers → Webhooks → Add endpoint), subscribe to the events Rally lists there (customer.created, customer.updated, checkout.session.completed, customer.subscription.*, invoice.paid, invoice.payment_failed, charge.refunded, charge.dispute.*), and paste the signing secret back into Rally. Settings → Tracking → Report sales shows Connected once it is.
2

Payment Links

Nothing to do. The snippet adds client_reference_id to every Payment Link on the page when the visitor came from a creator; Rally reads it from the completed session.
3

Checkout Sessions you create server-side

Pass the referral as client_reference_id, and your user id as creatorops_customer_id in metadata so the sale joins the lead you reported:
4

Customers you create yourself

Tag them so later invoices attribute:
How Rally attributes a Stripe customer, in order: creatorops_ref metadata (a referral id or a creator code), client_reference_id on the Checkout Session, creatorops_customer_id metadata (joined to a lead), then email match when the program allows it. Revenue comes from each paid invoice (subscriptions and invoiced charges) and, for one-time Checkout payments, from the completed session itself. Set customer_creation: "always" on one-time Checkouts so repeat buyers share one customer record. Whether one-time payments earn a commission is a program setting (revenue share base: all paid vs subscriptions only).
Use the same stable id everywhere: external_customer_id in the lead call and creatorops_customer_id in Stripe. That id is how Rally joins the signup to the payment.

4. Verify

Under Settings → Tracking → Verify installation, pick a hostname and click Verify installation. Rally fetches the page and checks the tag is there with your key. The four signals below it fill in as real traffic arrives: Quick local checks while developing: load your site with ?ref=a_test1234&via=TEST and confirm document.cookie contains rally_ref (a test ref proves the snippet runs; it does not attribute anyone). Confirm the lead call fires once per new account and is skipped without cookies.

Using a coding agent

Settings → Tracking → Coding agent prompt is one prompt for the whole setup, tailored to your stack, that a coding agent working in your repo can follow end to end. Create the backend key first and the prompt carries it as RALLY_API_KEY for the agent to put in your secret store. If you have Rally’s MCP connected, the agent can fetch the same guide itself.