This reference documents all methods available in the Tracker API and explains in detail how these methods work.
This method records actions your users perform on your application.
For a list of available events, see the event reference.
The track
method has the following signature:
croct.tracker.track(event: string, payload: EventPayload): Promise<Event>
The return is a Promise that resolves to the tracked event after successful transmission.
Here's a minimal example showing how track an event:
croct.tracker.track('goalCompleted', {goalId: 'newsletter-sign-up'});
This method enables automatic event tracking.
The enable
method has the following signature:
croct.tracker.enable(): void
Here's an example showing how to enable automatic event tracking:
croct.tracker.enable();
This method disables automatic event tracking.
💡️ Hint
You can still track events by calling thetrack
method even with automatic event tracking disabled.
The disable
method has the following signature:
croct.tracker.disable(): void
Here's an example showing how to disable automatic event tracking:
croct.tracker.disable();