Name:
interface
Value:
Amplify has re-imagined the way frontend developers build fullstack applications. Develop and deploy without the hassle.

Page updated Jun 26, 2025

Record events

AWS will end support for Amazon Pinpoint on October 30, 2026,, and is no longer accepting any new users as of May 20 (see the linked doc). The guidance is to use AWS End User Messaging for push notifications and SMS, Amazon Simple Email Service for sending emails, Amazon Connect for campaigns, journeys, endpoints, and engagement analytics. Pinpoint recommends Amazon Kinesis for event collection and mobile analytics.

Record event

The Amplify Analytics plugin makes it easy to record custom events within an app. The plugin handles retry logic in the event that the device loses network connectivity, and it automatically batches requests to reduce network bandwidth.

AnalyticsEvent event = AnalyticsEvent.builder()
.name("PasswordReset")
.addProperty("Channel", "SMS")
.addProperty("Successful", true)
.addProperty("ProcessDuration", 792)
.addProperty("UserAge", 120.3)
.build();
Amplify.Analytics.recordEvent(event);
val event = AnalyticsEvent.builder()
.name("PasswordReset")
.addProperty("Channel", "SMS")
.addProperty("Successful", true)
.addProperty("ProcessDuration", 792)
.addProperty("UserAge", 120.3)
.build()
Amplify.Analytics.recordEvent(event)
AnalyticsEvent event = AnalyticsEvent.builder()
.name("PasswordReset")
.addProperty("Channel", "SMS")
.addProperty("Successful", true)
.addProperty("ProcessDuration", 792)
.addProperty("UserAge", 120.3)
.build();
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.

Flush events

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.

val options = AWSPinpointAnalyticsPlugin.Options {
autoFlushEventsInterval = 60_000
}
Amplify.addPlugin(AWSPinpointAnalyticsPlugin(options))
Amplify.configure(AmplifyOutputs(R.raw.amplify_outputs), this)

To manually flush events, call:

Amplify.Analytics.flushEvents();
Amplify.Analytics.flushEvents()
RxAmplify.Analytics.flushEvents();

When flushing events, a Hub event 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.

Global Properties

You can register global properties which will be sent along with all invocations of Amplify.Analytics.recordEvent.

Amplify.Analytics.registerGlobalProperties(
AnalyticsProperties.builder()
.add("AppStyle", "DarkMode")
.build());
Amplify.Analytics.registerGlobalProperties(
AnalyticsProperties.builder()
.add("AppStyle", "DarkMode")
.build())
RxAmplify.Analytics.registerGlobalProperties(
AnalyticsProperties.builder()
.add("AppStyle", "DarkMode")
.build());

To unregister a global property, call Amplify.Analytics.unregisterGlobalProperties():

Amplify.Analytics.unregisterGlobalProperties("AppStyle", "OtherProperty");
Amplify.Analytics.unregisterGlobalProperties("AppStyle", "OtherProperty")
RxAmplify.Analytics.unregisterGlobalProperties("AppStyle", "OtherProperty");