Skip to main content

Add the tracking script to your site

Install Tolt's tracking script so it can record which partner sent each visitor.

Written by Nick

The tracking script records each visit through a partner link and remembers which partner sent the visitor. Every setup needs it, whichever billing provider you use. One script covers all your programs.

  1. Go to Settings › Tracking script.

    Tracking script page with the script and the Copy script button
  2. Under Install the script, open the tab for your site: HTML, Next.js or Google Tag Manager.

  3. Click Copy script and paste it inside the <head> tag of every page of your marketing site and your app. On Webflow, Framer or WordPress, use the site-wide head code.

  4. Publish your site.

Visits through partner links now show as clicks on the partner's links in Tolt.

Check that it works

  1. Open your site through a partner link, such as example.com/?ref=sam.

  2. In your browser console, run await tolt.ready(). It returns the click, partner and program IDs. null means the visit has no referral.

Good to know

  • If you already have a Tolt script tag, replace it with this one.

  • If your marketing site and app are on different subdomains, such as example.com and app.example.com, install the script on both. The referral carries over between them.

  • To record sign-ups, add the code under Track signups on the same page. See Track sign-ups as leads.

  • For more frameworks and edge cases, see Install tolt.js in the developer docs.

Did this answer your question?