This “track” method is used to track the user’s key event.

Method

public void track(@NonNull KeyEvent keyEvent, **int** eventId, Context context, **boolean** addGeo)

Parameters

keyEvent - KeyEvent 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(event, Tracker.EVENT_ID_ON_KEY, MainActivity.this, addGeo);