Skip to main content

Track sign-ups as leads

Record a lead in Tolt when someone a partner referred signs up for your product.

Written by Nick

Call window.tolt.signup() when someone signs up for your product, so Tolt records them as a lead and credits the partner who referred them. When that customer pays later, Tolt already knows which partner the payment belongs to.

Before you start

The Tolt tracking script must be on your website and on the page where people sign up. You'll find the script in Settings › Integrations: open your integration and copy it from Add the Tolt tracking script to your site.

Record the sign-up

  1. After a sign-up succeeds in your app, check that the visitor came through a partner link. The script sets window.tolt_data only for those visitors, and adds a customer_id to it once they're a lead.

  2. Call window.tolt.signup() with the customer's email address. Use the email they'll pay with, so their payments match the lead.

This JavaScript example runs both checks before it records the lead:

async function trackLead(email) {
// Only visitors who came through a partner link have tolt_data
if (!window.tolt_data) return;
// Skip visitors who are already a lead
if (window.tolt_data.customer_id) return;

try {
const result = await window.tolt.signup(email);
// result.customer_id is the customer's ID in Tolt
} catch (error) {
console.error("Tolt sign-up failed", error);
}
}

Check that it works

Sign up once through a partner link, then go to Customers. The new customer appears at the top with the Lead status and the partner who referred them.

Customers page with a new customer in Lead status at the top, credited to the partner who referred them

From then on, every sign-up through a partner link shows up in Customers as a lead, and the partner sees it in their partner portal.

Good to know

  • Calling window.tolt.signup() again with the same email doesn't create a second lead. Tolt returns Customer already exists.

  • If you record payments with Tolt's API, store the customer_id the call returns and send it when you create the transaction. The tolt.js tracking guide shows the full flow.

  • A lead becomes Trial or Active once the customer starts a trial or pays. See customer statuses.

  • If window.tolt_referral is null on a visit through a partner link, see What to do if tolt_referral is null.

Did this answer your question?