Webflow's custom code feature makes it straightforward to add tracking scripts globally across your entire website, perfect for SaaS marketing sites that need comprehensive affiliate tracking.
Add tracking script to your Webflow site
Webflow's recommended approach is to use the site-wide custom code settings, which ensures the tracking script loads on every page of your website.
-
Open your Webflow project dashboard
-
Go to Site Settings → Custom Code
-
In the Head Code section, add your tracking script:
<script async defer src="https://affonso.io/js/pixel.min.js" data-affonso="YOUR_PUBLIC_PROGRAM_ID" data-cookie_duration="YOUR_COOKIE_DURATION" ></script>
-
Click Save Changes
-
Publish your site for the changes to take effect
Alternative: Add the script to individual pages via Page Settings → Custom Code if you only need tracking on specific pages.
For more details, see Webflow's official custom code documentation.
Testing
- Publish your Webflow site after adding the code
- Visit your published site with
?atp=test
- Check browser DevTools → Console → type
window.affonso_referral
- Verify tracking in your Affonso dashboard
Note: Custom code only works on published sites, not in Webflow's preview mode.
Multi-Domain Setup
If you're using Webflow only for your marketing site (e.g., yourcompany.com
) and your application runs on a subdomain (e.g., app.yourcompany.com
), make sure to install the Affonso tracking script on both domains.
Affonso works seamlessly across subdomains - the same affiliate cookie will be shared between yourcompany.com
and app.yourcompany.com
. See our multi-domain setup guide for more details on cross-domain tracking.
Next Steps
Once installed, you can access affiliate referral data and pass it to your payment provider. Connect your payment provider →