Conversion tracking
The Rampify tracker records page views and outbound clicks automatically. A conversion is the moment that matters to you: a signup, a demo request, a waitlist form. Rampify credits each conversion to how the visitor first arrived in that browsing session (Google, a campaign link, ChatGPT, a newsletter), so you can see which sources and landing pages actually produce signups.
Conversions carry no personal data. Rampify records the session, the page, a label and an opaque conversion ID that you can store next to your own user record if you want to join the two later.
Install the tracker#
Add the script to every page you want tracked, before the closing </head> tag. Your site ID is on your project's Settings page.
<script defer src="https://www.rampify.dev/tracker.js" data-site-id="YOUR_SITE_ID"></script>
Record a conversion#
Pick the option that matches how your signup works.
A plain HTML form. Add data-rampify-conversion with a label. The tracker records the conversion when the form is submitted and adds a hidden rampify_cid field so the conversion ID rides along with your own form post.
<form action="/signup" method="post" data-rampify-conversion="signup">
…
</form>
A JavaScript or hosted signup (Clerk, Auth0, Supabase Auth, Google sign-in, Stripe, Typeform, a single-page app). Call trackConversion when the signup succeeds:
window.rampify.trackConversion({ label: 'signup' });
If you want to store the conversion ID with the new user, read it with window.rampify.getConversionId() before the signup completes (for example into Clerk's unsafeMetadata). trackConversion sends that same ID.
Call trackConversion as soon as the account exists, not after email verification. A verification link usually opens in a new tab, which is a new browsing session with no link to the visit that brought the person in.
From your backend. If you'd rather record the signup server-side (for example in a webhook), send the visitor's session with it so the conversion keeps its source. Read the session in the browser with window.rampify.getSessionId(), pass it to your backend with the signup, then post the event with a project API key:
curl -X POST https://www.rampify.dev/api/collect/event \
-H "Authorization: Bearer sk_live_…" \
-d '{"event_type":"form_submit","url":"https://app.example.com/signup","label":"signup","sess":"<session id>","cid":"<conversion id>"}'
A backend conversion sent without sess is still counted, but it has no source attached.
Sites on more than one subdomain#
A common setup is a marketing site on example.com and signup on app.example.com. Browsers keep each subdomain's session storage separate, so without extra setup the visit to app.example.com starts a new session whose source is your own marketing site. The signup then shows up as a referral from example.com, and the real source (Google, a campaign, ChatGPT) is lost.
To keep it as one session, list the sister domain on both sites, with the same site ID:
<!-- on example.com -->
<script defer src="https://www.rampify.dev/tracker.js"
data-site-id="YOUR_SITE_ID" data-link-domains="app.example.com"></script>
<!-- on app.example.com -->
<script defer src="https://www.rampify.dev/tracker.js"
data-site-id="YOUR_SITE_ID" data-link-domains="example.com"></script>
data-link-domainstakes a comma-separated list of hostnames.*.example.commatches every subdomain ofexample.com, but notexample.comitself, so list both if you need both.- Both sides need the attribute. The sending page adds the session to links, and the receiving page only accepts it when it lists the sending domain too.
- Without the attribute the tracker behaves exactly as before.
How it works#
When a visitor clicks a link to a listed domain, the tracker adds rampify_sid=<session>.<time> to that link. The tracker on the destination page continues that session, then removes the parameter from the address bar before recording the page view, keeping your other query parameters and your router's state. The visit to the app isn't recorded as a referral from your own site, so the conversion is credited to how the visitor originally arrived.
There are no cookies. The parameter expires two minutes after the click, and it's only accepted when the visitor came from your own domains, so a copied or shared link can't merge two people into one session.
Navigating in JavaScript#
Links are handled automatically, including middle-click and "open in new tab". If you send visitors to the other domain from code (location.href = … or window.open(…)), pass the URL through decorateUrl first:
window.location.href = window.rampify.decorateUrl('https://app.example.com/signup');
It adds the session only for listed domains and returns any other URL unchanged.
Single-page apps#
If app.example.com is a single-page app (React, Vue, Svelte, Vite), put the tracker tag before your app's bundle in index.html, so the parameter is removed before your router reads the URL.
If your app subdomain is also where signed-in customers use your product, load the tracker there only on your signup pages for now. Otherwise everyday product usage is counted alongside your marketing traffic, for example returning users opening the app directly show up as Direct visits.
What changes in your reports#
After you add the attribute, visits that move between your domains count as one session instead of two. Expect fewer sessions, fewer referrals from your own domain, and conversions moving from "referral from example.com" to their real source. That's the attribution getting more accurate, not a drop in traffic.
Limits#
- Forms on one domain that post directly to the other aren't carried across. Link to the signup page instead, or use
decorateUrlon the form'saction. - A visitor who types the app's address or opens it from a bookmark starts a new session as usual.