This “track” method is used to track menu options which are selected by the user.

Method

public void track(@NonNull MenuItem menuItem, **int** eventId, Context context, **boolean** addGeo)

Parameters

keyEvent	- MenuItem object.
eventId	  - event ID based on the passing events which is defined in the SDK.
context	  - The activity context.
addGeo	  - Flag used to decide whether to append the geo parameter(latitude and longitude) in the Payloads or Not.

Example

Tracker.singleton().track(item, Tracker.EVENT_ID_OPTIONS_MENU, MainActivity.this, addGeo);