diff --git a/src/pages/[platform]/build-a-backend/add-aws-services/analytics/record-events/index.mdx b/src/pages/[platform]/build-a-backend/add-aws-services/analytics/record-events/index.mdx index cb02018a996..e83686e4c37 100644 --- a/src/pages/[platform]/build-a-backend/add-aws-services/analytics/record-events/index.mdx +++ b/src/pages/[platform]/build-a-backend/add-aws-services/analytics/record-events/index.mdx @@ -130,85 +130,6 @@ RxAmplify.Analytics.flushEvents(); When flushing events, a [Hub event](/[platform]/build-a-backend/auth/connect-your-frontend/listen-to-auth-events/) is sent containing the events which were successfully sent to the Pinpoint service. To receive a list of these events, subscribe to the `HubChannel.ANALYTICS` channel and handle an event of the type `AnalyticsChannelEventName.FLUSH_EVENTS`. -## Authentication events - -Authentication events indicate how frequently users authenticate with your application. - -On the **Analytics** page, the **Users** tab displays charts for **Sign-ins, Sign-ups, and Authentication failures**. - -To learn how frequently users authenticate with your app, update your application code so that Amazon Pinpoint receives the following standard event types for authentication: - - - `_userauth.sign_in` - - `_userauth.sign_up` - - `_userauth.auth_fail` - -You can report authentication events by doing either of the following: - - - Managing user sign-up and sign-in with Amazon Cognito user pools. - - Cognito user pools are user directories that make it easier to add sign-up and sign-in to your app. As users authenticate with your app, Cognito reports authentication events to Pinpoint. For more information, see [Using Amazon Pinpoint Analytics with Amazon Cognito User Pools](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-pinpoint-integration.html) in the _Amazon Cognito Developer Guide_. Also update **amplify_outputs.json** by adding the `PinpointAppId` key under `CognitoUserPool`. - - ```json - "CognitoUserPool": { - "Default": { - "PoolId": "", - "AppClientId": "", - "Region": "", - "PinpointAppId": "" - } - } - ``` - -- Manually recording events using the `recordEvent()` API. - - If you don't want to use Cognito user pools, you can use the Pinpoint client to record and submit authentication events, as shown in the following examples. In these examples, the event type is set to `_userauth.sign_in`, but you can substitute any authentication event type. - - - - - ```java - /** - * Call this method to log an authentication event to the analytics client. - */ - public void logAuthenticationEvent() { - AnalyticsEvent event = AnalyticsEvent.builder() - .name("_userauth.sign_in") - .build(); - Amplify.Analytics.recordEvent(event); - } - ``` - - - - - ```kotlin - /** - * Call this method to log an authentication event to the analytics client. - */ - fun logAuthenticationEvent() { - val event = AnalyticsEvent.builder() - .name("_userauth.sign_in") - .build() - Amplify.Analytics.recordEvent(event) - } - ``` - - - - ```java - - /** - * Call this method to log an authentication event to the analytics client. - */ - public void logAuthenticationEvent() { - AnalyticsEvent event = AnalyticsEvent.builder() - .name("_userauth.sign_in") - .build(); - RxAmplify.Analytics.recordEvent(event); - } - ``` - - ## Global Properties