From dbe594b3515c6f99faab8f10f7677f11e81a6283 Mon Sep 17 00:00:00 2001 From: Thomas Leing Date: Thu, 3 Nov 2022 16:33:41 -0700 Subject: [PATCH 1/4] Add Auth Pinpoint events to Amplify docs, not just SDK --- src/fragments/lib-v1/analytics/ios/record.mdx | 43 +++++++++- .../lib/analytics/android/record.mdx | 80 +++++++++++++++++++ src/fragments/lib/analytics/ios/record.mdx | 41 ++++++++++ 3 files changed, 163 insertions(+), 1 deletion(-) diff --git a/src/fragments/lib-v1/analytics/ios/record.mdx b/src/fragments/lib-v1/analytics/ios/record.mdx index 32ee2db7700..5dbeb7c1127 100644 --- a/src/fragments/lib-v1/analytics/ios/record.mdx +++ b/src/fragments/lib-v1/analytics/ios/record.mdx @@ -1,6 +1,6 @@ ## Record Event -The Amplify Analytics plugin provides a simple interface to record custom events within your app. The plugin handles retry logic in the event the device looses network connectivity, and automatically batches requests to reduce network bandwidth. +The Amplify Analytics plugin provides a simple interface to record custom events within your app. The plugin handles retry logic in the event the device loses network connectivity, and automatically batches requests to reduce network bandwidth. ```swift func recordEvents() { @@ -42,6 +42,47 @@ Events have default configuration to flush out to the network every 60 seconds. > **Note**: If you set `autoFlushEventsInterval` to 0, you are responsible for calling `Amplify.Analytics.flushEvents()` to submit the recorded events to the backend. +## 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 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 **awsconfiguration.json** by adding the `PinpointAppId` key under `CognitoUserPool`. + + ```json + "CognitoUserPool": { + "Default": { + "PoolId": "", + "AppClientId": "", + "Region": "", + "PinpointAppId": "" + } + } + ``` + +- Reporting authentication events by using the Pinpoint client that's provided by the AWS Mobile SDK for iOS or Android. + + 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. + + ```swift + func sendUserSignInEvent() { + let event = BasicAnalyticsEvent( + name: "_userauth.sign_in" + ) + Amplify.Analytics.record(event: event) + } + ``` + ## Global Properties You can register properties which will be used across all `Amplify.Analytics.record(event:)` calls. diff --git a/src/fragments/lib/analytics/android/record.mdx b/src/fragments/lib/analytics/android/record.mdx index ff3413eac0d..75a16e464fa 100644 --- a/src/fragments/lib/analytics/android/record.mdx +++ b/src/fragments/lib/analytics/android/record.mdx @@ -101,6 +101,86 @@ RxAmplify.Analytics.flushEvents(); +## 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 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 **awsconfiguration.json** by adding the `PinpointAppId` key under `CognitoUserPool`. + + ```json + "CognitoUserPool": { + "Default": { + "PoolId": "", + "AppClientId": "", + "Region": "", + "PinpointAppId": "" + } + } + ``` + +- Reporting authentication events by using the Pinpoint client that's provided by the AWS Mobile SDK for iOS or Android. + + 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 You can register global properties which will be sent along with all invocations of `Amplify.Analytics.recordEvent`. diff --git a/src/fragments/lib/analytics/ios/record.mdx b/src/fragments/lib/analytics/ios/record.mdx index 6d4e203b256..7ce2eb0e795 100644 --- a/src/fragments/lib/analytics/ios/record.mdx +++ b/src/fragments/lib/analytics/ios/record.mdx @@ -43,6 +43,47 @@ Amplify.Analytics.flushEvents() The plugin automatically batches requests in order to reduce network bandwidth and handles the retry logic if the device loses connectivity. +## 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 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 **awsconfiguration.json** by adding the `PinpointAppId` key under `CognitoUserPool`. + + ```json + "CognitoUserPool": { + "Default": { + "PoolId": "", + "AppClientId": "", + "Region": "", + "PinpointAppId": "" + } + } + ``` + +- Reporting authentication events by using the Pinpoint client that's provided by the AWS Mobile SDK for iOS or Android. + + 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. + + ```swift + func sendUserSignInEvent() { + let event = BasicAnalyticsEvent( + name: "_userauth.sign_in" + ) + Amplify.Analytics.record(event: event) + } + ``` + ## Global Properties You can register properties which will be included across all `Amplify.Analytics.record(event:)` calls. From 938a8f3c0bc2b1862f250c3815927fb70ac72d6a Mon Sep 17 00:00:00 2001 From: Thomas Leing Date: Fri, 18 Nov 2022 18:24:18 -0800 Subject: [PATCH 2/4] Address review comments --- .../lib-v1/analytics/android/record.mdx | 86 ++++++++++++++++++- src/fragments/lib-v1/analytics/ios/record.mdx | 10 +-- .../lib/analytics/android/record.mdx | 4 +- src/fragments/lib/analytics/ios/record.mdx | 10 +-- 4 files changed, 95 insertions(+), 15 deletions(-) diff --git a/src/fragments/lib-v1/analytics/android/record.mdx b/src/fragments/lib-v1/analytics/android/record.mdx index 9306f3b8824..008e1c9f6a8 100644 --- a/src/fragments/lib-v1/analytics/android/record.mdx +++ b/src/fragments/lib-v1/analytics/android/record.mdx @@ -63,12 +63,12 @@ Events have default configuration to flush out to the network every 30 seconds. "awsPinpointAnalyticsPlugin": { "pinpointAnalytics": { "appId": "AppID", - "region": "Region" + "region": "Region", + "autoFlushEventsInterval": 10000 }, "pinpointTargeting": { "region": "Region" - }, - "autoFlushEventsInterval": 10000 + } } } } @@ -101,6 +101,86 @@ RxAmplify.Analytics.flushEvents(); +## 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 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 **amplifyconfiguration.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 You can register global properties which will be sent along with all invocations of `Amplify.Analytics.recordEvent`. diff --git a/src/fragments/lib-v1/analytics/ios/record.mdx b/src/fragments/lib-v1/analytics/ios/record.mdx index 5dbeb7c1127..81260607fe7 100644 --- a/src/fragments/lib-v1/analytics/ios/record.mdx +++ b/src/fragments/lib-v1/analytics/ios/record.mdx @@ -28,12 +28,12 @@ Events have default configuration to flush out to the network every 60 seconds. "awsPinpointAnalyticsPlugin": { "pinpointAnalytics": { "appId": "AppID", - "region": "Region" + "region": "Region", + "autoFlushEventsInterval": 60 }, "pinpointTargeting": { "region": "Region" - }, - "autoFlushEventsInterval": 60 + } } } } @@ -57,7 +57,7 @@ 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 **awsconfiguration.json** by adding the `PinpointAppId` key under `CognitoUserPool`. + 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 **amplifyconfiguration.json** by adding the `PinpointAppId` key under `CognitoUserPool`. ```json "CognitoUserPool": { @@ -70,7 +70,7 @@ You can report authentication events by doing either of the following: } ``` -- Reporting authentication events by using the Pinpoint client that's provided by the AWS Mobile SDK for iOS or Android. +- Manually recording events using the `record(event:)` 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. diff --git a/src/fragments/lib/analytics/android/record.mdx b/src/fragments/lib/analytics/android/record.mdx index 75a16e464fa..939ae8cfe29 100644 --- a/src/fragments/lib/analytics/android/record.mdx +++ b/src/fragments/lib/analytics/android/record.mdx @@ -116,7 +116,7 @@ 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 **awsconfiguration.json** by adding the `PinpointAppId` key under `CognitoUserPool`. + 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 **amplifyconfiguration.json** by adding the `PinpointAppId` key under `CognitoUserPool`. ```json "CognitoUserPool": { @@ -129,7 +129,7 @@ You can report authentication events by doing either of the following: } ``` -- Reporting authentication events by using the Pinpoint client that's provided by the AWS Mobile SDK for iOS or Android. +- 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. diff --git a/src/fragments/lib/analytics/ios/record.mdx b/src/fragments/lib/analytics/ios/record.mdx index 7ce2eb0e795..b4c805e30ae 100644 --- a/src/fragments/lib/analytics/ios/record.mdx +++ b/src/fragments/lib/analytics/ios/record.mdx @@ -21,9 +21,9 @@ If you would like to change this, update `amplifyconfiguration.json` and set the "awsPinpointAnalyticsPlugin": { "pinpointAnalytics": { "appId": "AppID", - "region": "Region" - }, - "autoFlushEventsInterval": 60 + "region": "Region", + "autoFlushEventsInterval": 60 + } } } } @@ -58,7 +58,7 @@ 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 **awsconfiguration.json** by adding the `PinpointAppId` key under `CognitoUserPool`. + 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 **amplifyconfiguration.json** by adding the `PinpointAppId` key under `CognitoUserPool`. ```json "CognitoUserPool": { @@ -71,7 +71,7 @@ You can report authentication events by doing either of the following: } ``` -- Reporting authentication events by using the Pinpoint client that's provided by the AWS Mobile SDK for iOS or Android. +- Manually recording events using the `record(event:)` 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. From b63480598bcd39399ba7afaf8bc1ed776cad48fa Mon Sep 17 00:00:00 2001 From: Thomas Leing Date: Mon, 19 Dec 2022 10:12:04 -0500 Subject: [PATCH 3/4] Use fragments for duplicates --- .../lib-v1/analytics/android/record.mdx | 30 ++----------------- src/fragments/lib-v1/analytics/ios/record.mdx | 30 ++----------------- .../getting-started/auth-events.mdx | 30 +++++++++++++++++++ .../lib/analytics/android/record.mdx | 30 ++----------------- src/fragments/lib/analytics/ios/record.mdx | 30 ++----------------- 5 files changed, 38 insertions(+), 112 deletions(-) create mode 100644 src/fragments/lib-v1/analytics/native_common/getting-started/auth-events.mdx diff --git a/src/fragments/lib-v1/analytics/android/record.mdx b/src/fragments/lib-v1/analytics/android/record.mdx index 008e1c9f6a8..b5b547ddaa4 100644 --- a/src/fragments/lib-v1/analytics/android/record.mdx +++ b/src/fragments/lib-v1/analytics/android/record.mdx @@ -102,36 +102,10 @@ RxAmplify.Analytics.flushEvents(); ## 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**. +import native_common from "/src/fragments/lib-v1/analytics/native_common/getting-started/auth-events.mdx"; -To learn how frequently users authenticate with your app, update your application code so that 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 **amplifyconfiguration.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. + diff --git a/src/fragments/lib-v1/analytics/ios/record.mdx b/src/fragments/lib-v1/analytics/ios/record.mdx index 81260607fe7..1e9e8a20149 100644 --- a/src/fragments/lib-v1/analytics/ios/record.mdx +++ b/src/fragments/lib-v1/analytics/ios/record.mdx @@ -43,36 +43,10 @@ Events have default configuration to flush out to the network every 60 seconds. > **Note**: If you set `autoFlushEventsInterval` to 0, you are responsible for calling `Amplify.Analytics.flushEvents()` to submit the recorded events to the backend. ## 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**. +import native_common from "/src/fragments/lib-v1/analytics/native_common/getting-started/auth-events.mdx"; -To learn how frequently users authenticate with your app, update your application code so that 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 **amplifyconfiguration.json** by adding the `PinpointAppId` key under `CognitoUserPool`. - - ```json - "CognitoUserPool": { - "Default": { - "PoolId": "", - "AppClientId": "", - "Region": "", - "PinpointAppId": "" - } - } - ``` - -- Manually recording events using the `record(event:)` 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. + ```swift func sendUserSignInEvent() { diff --git a/src/fragments/lib-v1/analytics/native_common/getting-started/auth-events.mdx b/src/fragments/lib-v1/analytics/native_common/getting-started/auth-events.mdx new file mode 100644 index 00000000000..6ca83fbd4f0 --- /dev/null +++ b/src/fragments/lib-v1/analytics/native_common/getting-started/auth-events.mdx @@ -0,0 +1,30 @@ +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 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 **amplifyconfiguration.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. \ No newline at end of file diff --git a/src/fragments/lib/analytics/android/record.mdx b/src/fragments/lib/analytics/android/record.mdx index 939ae8cfe29..96ff9c23505 100644 --- a/src/fragments/lib/analytics/android/record.mdx +++ b/src/fragments/lib/analytics/android/record.mdx @@ -102,36 +102,10 @@ RxAmplify.Analytics.flushEvents(); ## 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**. +import native_common from "/src/fragments/lib-v1/analytics/native_common/getting-started/auth-events.mdx"; -To learn how frequently users authenticate with your app, update your application code so that 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 **amplifyconfiguration.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. + diff --git a/src/fragments/lib/analytics/ios/record.mdx b/src/fragments/lib/analytics/ios/record.mdx index b4c805e30ae..7390ff811d6 100644 --- a/src/fragments/lib/analytics/ios/record.mdx +++ b/src/fragments/lib/analytics/ios/record.mdx @@ -44,36 +44,10 @@ Amplify.Analytics.flushEvents() The plugin automatically batches requests in order to reduce network bandwidth and handles the retry logic if the device loses connectivity. ## 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**. +import native_common from "/src/fragments/lib-v1/analytics/native_common/getting-started/auth-events.mdx"; -To learn how frequently users authenticate with your app, update your application code so that 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 **amplifyconfiguration.json** by adding the `PinpointAppId` key under `CognitoUserPool`. - - ```json - "CognitoUserPool": { - "Default": { - "PoolId": "", - "AppClientId": "", - "Region": "", - "PinpointAppId": "" - } - } - ``` - -- Manually recording events using the `record(event:)` 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. + ```swift func sendUserSignInEvent() { From 24844de45be896fd39f0ed9976607d61932aa70d Mon Sep 17 00:00:00 2001 From: Thomas Leing Date: Wed, 21 Dec 2022 20:46:50 -0500 Subject: [PATCH 4/4] Fix iOS Pinpoint JSON --- src/fragments/lib-v1/analytics/ios/record.mdx | 6 +++--- src/fragments/lib/analytics/ios/record.mdx | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/fragments/lib-v1/analytics/ios/record.mdx b/src/fragments/lib-v1/analytics/ios/record.mdx index 1e9e8a20149..0cca3909a1d 100644 --- a/src/fragments/lib-v1/analytics/ios/record.mdx +++ b/src/fragments/lib-v1/analytics/ios/record.mdx @@ -28,12 +28,12 @@ Events have default configuration to flush out to the network every 60 seconds. "awsPinpointAnalyticsPlugin": { "pinpointAnalytics": { "appId": "AppID", - "region": "Region", - "autoFlushEventsInterval": 60 + "region": "Region" }, "pinpointTargeting": { "region": "Region" - } + }, + "autoFlushEventsInterval": 60 } } } diff --git a/src/fragments/lib/analytics/ios/record.mdx b/src/fragments/lib/analytics/ios/record.mdx index 7390ff811d6..5ff04ce0ce8 100644 --- a/src/fragments/lib/analytics/ios/record.mdx +++ b/src/fragments/lib/analytics/ios/record.mdx @@ -21,9 +21,9 @@ If you would like to change this, update `amplifyconfiguration.json` and set the "awsPinpointAnalyticsPlugin": { "pinpointAnalytics": { "appId": "AppID", - "region": "Region", - "autoFlushEventsInterval": 60 - } + "region": "Region" + }, + "autoFlushEventsInterval": 60 } } }