What is Affonso?
Affonso is an affiliate marketing software that enables SaaS businesses to launch, manage, and scale their own affiliate programs. With Affonso, you can:- Set up flexible commission structures
- Manage multiple affiliate programs from one dashboard
- Provide your affiliates with real-time tracking and marketing resources
- Automate affiliate payments and commission calculations
Integration Steps
1. Create a Polar Access Token for Affonso
First, you’ll need to create an API token in Polar that Affonso can use to communicate with your account:- Login to your Polar Dashboard
- Navigate to Settings in the main menu
- Scroll down to the Developers section on the Settings page
- Click the New token button
- Give your token a name (e.g., “Affonso Integration”)
- Set token expiration to No expiration Important: If you set an expiration date, you’ll need to manually update the token in Affonso when it expires. Tracking will stop working if the token expires.
- Enable all the following scopes:
- discounts:read
- discounts:write
- events:read
- subscriptions:read
- customers:read
- customers:write
- orders:read
- refunds:read
- webhooks:read
- webhooks:write
- Click Create token and copy the generated token
- Provide this token to Affonso by entering it in their integration settings
2. Set Up Webhooks in Polar
After connecting your Polar account with Affonso, you’ll receive a webhook URL and secret from Affonso. Add these to your Polar account:- Go to Settings → Developers → Webhooks in your Polar Dashboard
- Click the “Add Endpoint” button
- In the URL field, paste the webhook URL provided by Affonso
- For Format, select RAW from the dropdown
- In the Secret field, paste the webhook secret provided by Affonso
- Under Events, enable all of the following:
order.created
order.refunded
subscription.canceled
- Click Save to complete the webhook setup
3. Add the Affonso Tracking Script to Your Website
Add Affonso’s tracking script to the<head>
tag of your website:
YOUR_AFFONSO_PROGRAM_ID
with the unique program ID provided by Affonso.
This script should be placed on all pages of your website, including:
- Your main marketing website
- Your application domain
- Any subdomains where users might land or make purchases
4. Track User Signups (Optional)
For better conversion insights, you can track when users sign up through an affiliate link:5. Pass Referral Data to Polar Checkout
To ensure proper commission attribution, pass the referral data when creating checkout sessions:How It Works
- When a user visits your site through an affiliate link, Affonso’s script stores a unique identifier in a cookie
- If you’ve implemented signup tracking, Affonso records when the user creates an account
- When the user makes a purchase, the referral ID is passed to Polar as metadata
- Polar’s webhook notifies Affonso about the purchase
- Affonso attributes the sale to the correct affiliate and calculates the commission
Benefits of the Integration
- Automated Tracking: No manual work required to track affiliate-driven sales
- Real-Time Analytics: Both you and your affiliates get immediate insights into performance
- Seamless User Experience: The integration works behind the scenes without affecting your checkout flow
- Flexible Commission Structures: Set up complex commission rules based on product, subscription duration, etc.
Getting Help
More details about the integration: Polar Affiliate Program If you need assistance with your Affonso integration, contact Affonso’s support team:- Email: hello@affonso.io
- Live chat: Available directly in the Affonso dashboard