Duda's custom code capabilities make it straightforward to add tracking scripts globally across your website, perfect for agencies and businesses using Duda's responsive website builder.
Add tracking script to your Duda site
Duda's recommended approach is to use the site-wide custom code settings, which ensures the tracking script loads on all pages of your website.
-
Open your Duda website in the editor
-
Click on Settings in the left sidebar
-
Go to Custom Code
-
In the Site-wide HTML Head 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
-
Publish your site for the changes to take effect
Alternative: Use page-specific custom code by going to Page Settings → Custom Code for individual pages, though site-wide injection is preferred.
For more details, see Duda's custom code documentation.
Testing
- Publish your Duda site after adding the custom 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 features may require a higher-tier Duda plan.
Multi-Domain Setup
If you're using Duda 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 →