Insightful tripled their affiliate revenue after switching. Free white-glove migration; your affiliates keep their links.

Migrate for Free

Installing sign up snippet (into code) to send us referral data.

Joran HofmanWritten by Joran Hofman, Founder of Reditus
Tracking basics & Installation guidessnippettracking sign uptracking referralinstallation

The signup snippet is one line of code that tells Reditus a referred visitor created an account. Fire it once, in your code, right after a successful new registration, with the new user's email or your own unique ID for them. Install the tracking script first: the snippet only works on pages where the script runs.

How it works

When a visitor arrives through an affiliate link, the tracking script records that they came through an affiliate. If they sign up within your program's cookie window, the snippet sends Reditus their email (or your unique ID), and Reditus credits the signup to the affiliate as a referral. When that customer pays, Reditus matches the payment on the same email or ID and creates the commission. Your affiliates never see the full email: in their dashboard they see a masked version, with the first letter, then stars, then the domain.

Where to find the snippet

In the installation tab of your Reditus settings. Use the copy button to avoid typos, then replace the example email with the real email from your signup form:

window.gr("track", "conversion", { email: "email@example.com" });

Where in your signup flow to fire it

  • At the moment of signup: once, on a successful new registration. Only on new signups, never on logins.
  • With several signup methods (email and password, Google, Microsoft, Facebook), trigger it at the step right after signup, for example the first onboarding step or just after email verification, so every path is covered.
  • Test every signup path: a snippet wired only to the email-and-password form misses every Google signup.
  • Your site also has a demo booking? Track both. Connecting Calendly doesn't track signups through your form; that is the most common setup mistake we see.

Examples

JavaScript

Call the snippet in the success handler of your signup:

if (typeof window.gr === "function") {
window.gr("track", "conversion", { email: newUserEmail });
} else {
console.error("Reditus tracking script not running");
}

React

Call the same line in the callback that runs after a successful signup, with the email the user just registered:

signUp(values).then(() => {
if (typeof window.gr === "function") {
window.gr("track", "conversion", { email: values.email });
}
});

Ruby on Rails (Devise)

In your registrations controller, store the new user's email in the session once the account is saved:

resource.save
if resource.persisted?
session[:reditus_referral] = sign_up_params[:email]
end

Then render the snippet in your layout (app/views/layouts/application.html.erb) when that value is present, and clear the value right after, so the snippet fires only once:

<% if session[:reditus_referral].present? %>
<script>
window.gr("track", "conversion", { email: "<%= session[:reditus_referral] %>" });
</script>
<% session.delete(:reditus_referral) %>
<% end %>

Send your own unique ID

Email addresses can change; an ID you own doesn't. You can send your own unique ID for the user next to the email:

window.gr("track", "conversion", { email: "email@example.com", uid: "your-internal-user-id" });

This is also how UID tracking (no emails needed) works: send your own account or organization IDs instead of email addresses. Combined with server-side tracking, no customer emails or visitor profiles reach Reditus. That holds when payment data goes through the Payments API and the Stripe, HubSpot and Calendly integrations are not connected, because each of them brings the email address to Reditus on its own. UID tracking is opt-in: without it, the referred person's email is sent.

  • With Stripe: add the same ID to the Stripe customer's metadata as user_id, so Reditus can match the Stripe customer to the referral. If you also send the Stripe customer ID with the snippet, fire the snippet within about 30 seconds of Stripe creating the customer. The advanced installation guide shows how.
  • With the API: if you track signups server-side, use the V2 tracking endpoint and include the uid. See the developer documentation.

Test it

Make a test signup on your own platform through every signup method you offer, then check the installation tab: a test signup is the only way to validate the snippet. Step by step: testing the signup snippet.

Need help? Ask us in the chat in the app.

Ready to grow your SaaS?

  • 14-day free trial
  • Easy to use
  • No credit card required