Connect your Polar account to Tolt and start tracking referrals and commissions automatically.
1. Go to your Polar account
You need a Polar account to connect it with Tolt. If you don’t have one yet, create an account on Polar.
2. Add your Polar API credentials and set up webhooks
Go to your Polar Account Settings → General
Scroll to the bottom and click Create Token
Select all scopes and create the token
Copy the Access Token and paste it in the API Key field in Tolt
Next, set up your webhook:
Go to Settings → Webhooks
Click Add Endpoint
Use this Webhook Endpoint:
https://e39cb990c2.execute-api.us-east-1.amazonaws.com/v1/polar?id=int_pk_HPr7A7u8AqHn9etPtSKc6hWA
Set Format to
Raw
Generate a Secret and paste it into Tolt
Click Create
Make sure to select the following events:
checkout.created
customer.created
order.created
subscription.created
subscription.updated
subscription.canceled
refund.created
3. Add the Tolt tracking script to your site
Insert the Tolt tracking script in your <head>
tag. We recommend placing it on all pages for the best results.
Standard Script:
<script async src="https://cdn.tolt.io/tolt.js" data-tolt="YOUR_DATA_TOLT_ID"></script>
Google Tag Manager Version:
<script> var toltScript = document.createElement('script'); toltScript.src = 'https://cdn.tolt.io/tolt.js'; toltScript.setAttribute('data-tolt', 'YOUR_DATA_TOLT_ID'); document.head.appendChild(toltScript); </script>
4. Send referral ID to Polar
To track conversions, pass the Tolt referral ID to Polar’s checkout.
Tolt generates a unique referral ID via the script (window.tolt_referral
). You’ll need to include it in the metadata of the Polar checkout session.
Example:
const checkout = await polar.checkout.create({ items: [{ price: 'price_id', quantity: 1 }], metadata: { referral_id: window.tolt_referral, } });
This ensures the referral is tied to the correct partner.