Autocapture
Learn about how the Koala pixel autocaptures events.
What is autocapture?
By default, Koala will automatically capture 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 capture these events. Koala will automatically capture them for you. Whether you have a single page app or a traditional website.
Disabling autocapture
You can disable autocapture 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 autocapture of pageviews, form submissions, active session time, and presence.
Manually/programmatically enabling or disabling autocapture at runtime
You may want to enable or disable autocapture 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()
.