Install the web script
Add one script, record your sign-up goal, and carry the visitor ID into checkout.
Add the snippet
Open your product’s Settings and copy its public ingest key into this example. Place the snippet in the head of every page. The queue helper preserves calls made before the script loads. These examples use placeholders; do not install a second copy of the script.
<script>window.rr=window.rr||function(){(rr.q=rr.q||[]).push(arguments)}</script>
<script defer src="https://routerev.com/r.js" data-key="pk_your_product"></script>Optional first-party collector
The default script and endpoint use routerev.com. For an own-domain collector, arrange an e.yourdomain.com CNAME and its RouteRev domain configuration during early access. DNS must be DNS-only in Cloudflare. Replace both host values below with the configured host. Tracked /go links require that product-specific host.
data-api optionally overrides the collector endpoint. data-app-store-pt is your App Store provider token: it lets ordinary App Store links carry the first source as pt/ct. Keep it off data-rr-goal elements so the handoff tagging can run.
<script defer src="https://e.yourdomain.com/r.js"
data-key="pk_your_product" data-api="https://e.yourdomain.com/e"
data-app-store-pt="YOUR_PROVIDER_TOKEN"></script>Goals and signed-in identity
Use your product’s configured sign-up goal — the default is sign_up — so sign-ups count in the funnel. Call identify with your own account ID after sign-in; use the same ID on web and iOS.
rr('goal', 'sign_up', { plan: 'pro' });
rr('identify', user.id);Goals on buttons and links
data-rr-goal records a goal when the element is clicked. Use a distinct goal such as signup_click for a button press. Send your configured sign-up goal only after account creation succeeds, using rr('goal', …) in your success handler. Ordinary external links record outbound_click automatically.
<button data-rr-goal="signup_click">Create account</button>
<a href="/pricing" data-rr-goal="view_pricing">See pricing</a>Debug and exclude your browser
data-debug logs events locally. Set rr_ignore and reload to exclude this browser; remove it and reload to resume. Localhost is skipped unless data-allow-localhost is present. Automated/headless browsers are skipped.
<!-- Add data-debug to your installed script tag -->
<script defer src="https://routerev.com/r.js"
data-key="pk_your_product" data-debug></script>// Exclude this browser, then reload.
localStorage.setItem('rr_ignore', '1');// Include this browser again, then reload.
localStorage.removeItem('rr_ignore');Cookies and privacy
Cookies are first-party on your product’s domain, even when the script loads from routerev.com. The client also stores rr_uid locally for the signed-in user ID. No IDFA or fingerprinting. Tell users about collection and obtain consent where required.
| Cookie | Purpose | Lifetime |
|---|---|---|
| _rr_vid | Anonymous visitor ID, readable by your server for Stripe attribution | 365 days, refreshed |
| _rr_sid | Session ID; each event extends the session | 30 minutes rolling |
| _rr_ft | First non-direct source for App Store campaign link handoff | 365 days |