Reporting Events

You can use the AWS Mobile SDK for iOS to report app usage data, or events, to
Amazon Pinpoint. Report events to capture information such as app session times, users'
purchasing
behavior, sign-in attempts, or any custom event type that serves your needs.

After your app reports events, view app analytics in the Amazon Pinpoint console.
The charts on the
Analytics page provide metrics for many aspects of user behavior.
For more information, see Chart Reference for
Amazon Pinpoint Analytics in the Amazon Pinpoint User Guide.

Reporting Session Events

Session events indicate when and how often users open and close your app. The
AWS Mobile SDK for iOS automatically records session events when your app goes into
the foreground
and background. This behavior is configurable, and you may choose to implement your
own
session handling.

Reporting Authentication Events

To learn how frequently users authenticate with your app, update your app code so
that
Amazon Pinpoint receives the following standard event types for authentication:

_userauth.sign_in

_userauth.sign_up

_userauth.auth_fail

After Amazon Pinpoint receives these event types, use the Analytics page in
the Amazon Pinpoint console to view charts for Sign-ins,
Sign-ups, and Authentication
failures.

You can report authentication events by doing either of the following:

Managing user sign-up and sign-in with Amazon Cognito user pools.

Submitting events with the AWSPinpoint class.

Amazon Cognito user pools provide user directories that make it easier to add sign-up
and
sign-in to your app. As users authenticate with your app, Amazon Cognito reports authentication
events to Amazon Pinpoint. For more information, see Using Amazon Pinpoint
Analytics with Amazon Cognito User Pools in the Amazon Cognito
Developer Guide.

If you don't want to use Amazon Cognito user pools, you can use the
analyticsClient of the AWSPinpoint class to record and
submit authentication events, as shown in the following examples. The event type is
set
to _userauth.sign_in, but you can substitute any authentication event
type.

Reporting Custom Events

In addition to the standard events supported by Amazon Pinpoint, you can create custom
events by
assigning custom types to the events reported by your app. A custom event must have
an
event type, and you can add custom attributes and metrics.

After your app reports custom events, view the related analytics in the Amazon Pinpoint
console.
On the Analytics page, the Events tab provides
metrics for all custom events reported by your app.

The following examples use the analyticsClient of the
AWSPinpoint class to create a custom event.