<head> of every page, on your marketing site and your app.
YOUR_PUBLIC_KEY in Dashboard → Settings → Integrations. It is safe in the browser and is not your API key.
acme.com/?ref=sam tolt.jsclick Tolt
In the browser
cookies.acme.com
tolt_referral8537db0b…
tolt_data
expires30d
In Tolt
click8537db0b…
partner_idpart_8fKq…
program_idprg_YxLm…
page/?ref=sam
The cookie lasts your program’s cookie duration (30 days by default).
Add it to your framework
- HTML
- Next.js
- React
- Vue / Nuxt
- No-code
Paste the tag inside
<head> on every page, or in your shared layout template.index.html
Check that it works
1
Open a partner link
Visit your site through any partner’s link, for example
https://acme.com/?ref=sam.2
Read the tracking data
Open the browser console and run:
null means this visit has no referral. tolt.getTracking() returns the same data without waiting.3
Find the cookie
In DevTools → Application → Cookies you should see
tolt_referral and tolt_data. The click also shows up in your dashboard.Edge cases
Marketing site and app on different subdomains
Marketing site and app on different subdomains
tolt.js writes its cookies on your root domain (
.acme.com) automatically, so a click on acme.com is still there when the visitor signs up on app.acme.com. Install the script on both. To force a specific domain, add data-cookie-domain=".acme.com" to the tag. Cookies can’t be shared across different root domains.Single-page apps that strip ?ref from the URL
Single-page apps that strip ?ref from the URL
tolt.js reads the URL once, when it loads. If your router rewrites the URL first, the referral is lost. Load the script in the initial HTML (or as early as possible) so it runs before any client-side redirect.
Which URL parameters are tracked
Which URL parameters are tracked
tolt.js looks for the first of these in the query string (or hash):
tolt, ref, aff, via, lmref, fpr, tap_s, afmc, f2f-ref, join, ali. Your program’s links use the parameter you chose in program settings.
