Mobile Track Events Example

Last Updated:

This example shows a Track event embedded into an alert dialog and triggered once the OK button is clicked. The Track event part of the code is bolded.

See here for general information about Track Events.


public void onClick(View view) {

        switch (view.getId()) {


                new AlertDialog.Builder(getContext())


                        .setPositiveButton(getString(R.string.dialog_ok), new DialogInterface.OnClickListener() {


                            public void onClick(DialogInterface dialog, int which) {

                                Pendo.track("OK_Track", null);






let otherAction = UIAlertAction(title: otherButtonTitle, style: .default) { _ in

            NSLog("The \"Secure Text Entry\" alert's other action occured.")

            PendoManager.shared().track("OK_Track", properties: nil)




The Track events are collected by Pendo instantly and are displayed first as Raw events in Settings > Subscription Settings > You app > Raw Events.



Up to an hour after, the Track events are displayed as aggregated data and are shown in the UI. To view the Track Events, go to Product > Track Events and change the time filter to Today to see today’s results.