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 e27e8f3b146..e727deb4e5c 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 @@ -86,31 +86,20 @@ RxAmplify.Analytics.recordEvent(event); The Amazon Pinpoint event count updates in minutes after recording your event. -However, it can take upwards of 30 minutes for the event to display in the Filter section, and for its custom attributes to appear in Pinpoint. +However, it can take upwards of 30 minutes for the event to display in the Filter section, and for its custom attributes to appear in Pinpoint. ## Flush events -Events have a default configuration to flush out to the network every 30 seconds. If you would like to change this, update `amplify_outputs.json` with the value in milliseconds you would like for `autoFlushEventsInterval`. This configuration will flush events every 10 seconds: +Events have a default configuration to flush out to the network every 30 seconds. You can change this value by passing the `autoFlushEventsInterval` option to the `AWSPinpointAnalyticsPlugin`. The option value is measured in milliseconds. -```json -{ - "analytics": { - "plugins": { - "awsPinpointAnalyticsPlugin": { - "pinpointAnalytics": { - "appId": "", - "region": "", - "autoFlushEventsInterval": 10000 - }, - "pinpointTargeting": { - "region": "" - } - } - } - } +```kotlin +val options = AWSPinpointAnalyticsPlugin.Options { + autoFlushEventsInterval = 60_000 } +Amplify.addPlugin(AWSPinpointAnalyticsPlugin(options)) +Amplify.configure(AmplifyOutputs(R.raw.amplify_outputs), this) ``` To manually flush events, call: @@ -173,7 +162,7 @@ You can report authentication events by doing either of the following: - 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. - + @@ -310,7 +299,7 @@ Future recordCustomEvent() async { The Amazon Pinpoint event count updates in minutes after recording your event. -However, it can take upwards of 30 minutes for the event to display in the Filter section, and for its custom attributes to appear in Amazon Pinpoint. +However, it can take upwards of 30 minutes for the event to display in the Filter section, and for its custom attributes to appear in Amazon Pinpoint.