trackCustomEvent
The trackCustomEvent() method records actions performed by users on your mobile app – like button presses, gestures or voice commands.
Syntax
await FlutterPiwikPro.sharedInstance.trackCustomEvent(
action: 'action',
category: 'category',
name: 'name',
value: value);
Parameters
category (string, required)
The category of the tracked event. You can define event categories based on actions (clicks, gestures, voice commands) or features (play, pause, fast forward).
action (string, required)
The action of the tracked event. Example: A category could be user clicks, an action could be a button click.
name (string, optional)
The name of the tracked event. For example, if you have multiple button controls on the screen, you can use the name to record the specific ID of the button that was clicked.
value (float, optional)
The value you want to assign to the tracked event. For example, if you’re tracking “Buy” button presses, you can record the number of purchased items or the total cost.
path (string, optional)
The URL path set for this event.
Examples
To send a custom event when a user clicks a signup button on /main/sign-up
and assign the value 100
to the event:
await FlutterPiwikPro.sharedInstance.trackCustomEvent(
action: 'Clicks',
category: 'Button',
name: 'Sign up',
value: 100);
Notes
- For more on custom events, see this article.
Updated 6 days ago