TYPO3's powerful template system and TypoScript configuration make it flexible to add tracking scripts globally across your enterprise website, perfect for organizations using TYPO3 for their web presence.
Add tracking script to your TYPO3 site
The recommended approach is to add the script via TypoScript in your site configuration, ensuring the script loads on all pages consistently across your TYPO3 installation.
-
Access your TYPO3 backend
-
Go to Template module
-
Select your root page template
-
Go to Setup field
-
Add the following TypoScript code:
page { headerData.999 = TEXT headerData.999.value ( <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
-
Clear all caches (Admin Tools → Flush TYPO3 and PHP Cache)
Alternative: Add the script directly to your Fluid template files in the <head>
section, or use the "Additional Header Data" field in page properties.
For more details, see TYPO3's TypoScript documentation and template configuration guide.
Testing
- Clear TYPO3 cache after adding the TypoScript
- Visit your TYPO3 site with
?atp=test
- Check browser DevTools → Console → type
window.affonso_referral
- Verify tracking in your Affonso dashboard
Note: TypoScript changes require cache clearing to take effect.
Multi-Domain Setup
If you're using TYPO3 only for your main website (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 →