Autotracking
Learn about how the Koala pixel automatically tracks events.
What is autotracking?
By default, Koala will automatically track certain events on your website. This includes:
- pageviews
- form submissions
- active session time
- presence (when a user is active on your site vs idle)
This means that you don’t need to write any code to track these events. Koala will automatically track them for you. Whether you have a single page app or a traditional website.
Disabling autotracking
You can disable autotracking entirely by setting the autocapture
option to false
when you initialize the Koala pixel.
When loading from the CDN/script tag, add this before your script:
When using the NPM package, add this to your initialization:
This will fully disable all autotracking of pageviews, form submissions, active session time, and presence.
Manually/programmatically enabling or disabling autotracking at runtime
You may want to enable or disable autotracking temporarily on some pages, for instance, if you are using Koala in a SPA that navigates seamlessly across your marketing site and product dashboard.
You can do this by calling ko.startAutocapture()
and ko.stopAutocapture()
.