trackCustomEvent
The trackCustomEvent() method tracks actions performed users take in your mobile app, such as button clicks, gestures, or voice commands.
Syntax
await FlutterPiwikPro.sharedInstance.trackCustomEvent(
action: 'action',
category: 'category',
name: 'name',
value: value);Parameters
category (string, required)
The event category. You can define event categories based on actions, such as clicks, gestures, voice commands, or features, such as play, pause, fast forward.
action (string, required)
The event action. Example: for the user clicks category, the action could be button click.
name (string, optional)
The event name. Use it to identify a specific item related to the event. For example, if you have multiple buttons on a screen, you can use the name to send the ID of the clicked button.
value (float, optional)
The value assigned to the tracked event. For example, when tracking Buy button clicks, you can send 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/signup, and assign the value 100 to the event:
await FlutterPiwikPro.sharedInstance.trackCustomEvent(
action: 'Clicks',
category: 'Button',
name: 'Sign up',
value: 100);Notes
- For more about custom events, read this article.
Updated 21 days ago