TYPO3
Add Rybbit analytics to your TYPO3 site
TYPO3 sitepackages build the page <head> from TypoScript rather than an HTML template, so the snippet is added as a page.includeJS entry in your sitepackage's setup.typoscript.
Get your tracking snippet
In your Rybbit dashboard, open Site Settings → Tracking Script and copy your snippet. It looks like this:
<script src="https://app.rybbit.io/api/script.js?siteId=YOUR_SITE_ID" defer></script>YOUR_SITE_ID is the numeric ID of your site. If you self-host Rybbit, app.rybbit.io is the domain of your own instance.
Add the snippet to TYPO3
-
Open your main TypoScript setup file, usually
<sitepackage>/Configuration/TypoScript/setup.typoscript. It is the file that already containspage = PAGE. The same TypoScript can also live in a TypoScript record in the backend. -
Add the script to the
pageobject:page = PAGE page { includeJS { rybbit = https://app.rybbit.io/api/script.js?siteId=YOUR_SITE_ID rybbit.defer = 1 } }Because the Site ID is part of the URL, no
data-*attribute is needed, so this works on every supported TYPO3 version. Per-include attributes onincludeJSonly exist in TYPO3 12.1+. -
To track production only, wrap the include in an
applicationContextcondition:[applicationContext == "Production"] page.includeJS.rybbit = https://app.rybbit.io/api/script.js?siteId=YOUR_SITE_ID page.includeJS.rybbit.defer = 1 [END] -
Optionally keep the Site ID and instance URL in
constants.typoscript(or a TypoScript record) so the setup file can be committed without site-specific values:# constants.typoscript rybbit { host = https://app.rybbit.io siteId = YOUR_SITE_ID } # setup.typoscript page.includeJS.rybbit = {$rybbit.host}/api/script.js?siteId={$rybbit.siteId} page.includeJS.rybbit.defer = 1 -
Deploy the sitepackage, or set
applicationContextaccordingly, and flush the TYPO3 caches.
Verify installation
Open your live site in a new tab and click through a few pages. Within a few seconds the pageviews appear in the Rybbit dashboard.
If nothing shows up:
- View the page source and search for
script.js?siteId=to confirm the snippet is on the page. - Open the browser Network tab and check that
script.jsreturns200and thatPOSTrequests go to/api/track. - Disable ad blockers, or set up a proxy so the script loads from your own domain.
- See the script troubleshooting guide for other common causes.
Troubleshooting
- Script not in the page source: TYPO3 caches rendered pages. Flush caches from the backend toolbar or with
vendor/bin/typo3 cache:flushafter changing TypoScript. - Wrong TypoScript file: if several files define
page, check the resultingpage.includeJSin the TypoScript object browser in the backend to see which definition wins. - Condition never matches: the
applicationContextis set through theTYPO3_CONTEXTenvironment variable. If it is unset, TYPO3 runs asProductionand the script loads everywhere.
Next steps
- Track custom events such as signups, purchases and button clicks.
- Identify users to connect sessions to accounts.
- Proxy the script through your own domain to bypass ad blockers.
- Script attributes let you skip or mask URLs and tag events.