Installation
Add the tolt.js script to the head of your website/app:
<script
src="https://cdn.tolt.io/tolt.js"
data-tolt="YOUR_PUBLIC_ORG_KEY"
></script>
<script
src="https://cdn.tolt.io/tolt.js"
data-tolt="YOUR_PUBLIC_ORG_KEY"
></script>
<script>
var toltScript = document.createElement('script');
toltScript.src = 'https://cdn.tolt.io/tolt.js';
toltScript.setAttribute('data-tolt', 'YOUR_PUBLIC_ORG_KEY');
document.head.appendChild(toltScript);
</script>
Tracking Data
When a visitor arrives through a partner link, window.tolt_data
contains:
{
click_id: "30aa8b8d-b846-4827-bd6f-6beb16466841",
cookie_duration: 30,
partner_id: "f468da94-f786-485c-9314-3008ce472188",
program_id: "prg_YRsbPDAKhWAdqJbFACheh",
customer_id: null // Only present after signup
}
If no affiliate link was used, window.tolt_data
will be null
.
Lead Tracking
The script provides a signup function to convert clicks into leads:
const result = await window.tolt.signup("unique_identifier");
// unique_identifier can be an email or unique ID
// Returns:
{
click_id: "30aa8b8d-b846-4827-bd6f-6beb16466841",
customer_id: "cus_aE1xbsSk3HuZk58B2usFXNSv",
customer_identifier: "unique_identifier",
partner_id: "f468da94-f786-485c-9314-3008ce472188",
program_id: "prg_YRsbPDAKhWAdqJbFACheh",
message: "Success"
}
After a successful signup, window.tolt_data
will be updated to include the customer_id
.