sendEventWithCategory

The sendEventWithCategory() method records actions performed by users on your mobile app – like button presses, gestures or voice commands.

Syntax

[[PiwikTracker sharedInstance] 
    sendEventWithCategory:@"category" 
                   action:@"action" 
                     name:@"name" 
                    value:@(value) 
                     path:@"path"];

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 on a signup button on /main/signup and assign the value 100 to the event:

[[PiwikTracker sharedInstance] sendEventWithCategory:@"Clicks"
                                               action:@"Button"
                                                 name:@"Sign up"
                                                value:@100
                                                 path:@"/main/signup"];

Notes