Amazon Pinpoint
Developer Guide

App Events

After you integrate your app with Amazon Pinpoint, Amazon Pinpoint streams events about user activity and campaign message deliveries.

Example

The JSON object for an app event contains the data shown in the following example.

{ "event_type": "_session.stop", "event_timestamp": 1487973802507, "arrival_timestamp": 1487973803515, "event_version": "3.0", "application": { "app_id": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6", "cognito_identity_pool_id": "us-east-1:a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6", "package_name": "main.page", "sdk": { "name": "aws-sdk-mobile-analytics-js", "version": "0.9.1:2.4.8" }, "title": "title", "version_name": "1.0", "version_code": "1" }, "client": { "client_id": "m3n4o5p6-a1b2-c3d4-e5f6-g7h8i9j0k1l2", "cognito_id": "us-east-1:i9j0k1l2-m3n4-o5p6-a1b2-c3d4e5f6g7h8" }, "device": { "locale": { "code": "en_US", "country": "US", "language": "en" }, "make": "generic web browser", "model": "Unknown", "platform": { "name": "android", "version": "10.10" } }, "session": { "session_id": "f549dea9-1090-945d-c3d1-e4967example", "start_timestamp": 1487973202531, "stop_timestamp": 1487973802507 }, "attributes": {}, "metrics": {} }

App Event Attributes

This section defines the attributes that are included in the app event stream.

Attribute Description
event_type

The type of event. Possible values:

  • _session.start – The endpoint began a new session.

  • _session.stop – The endpoint ended a session.

  • _userauth.sign_in – The endpoint logged in to your app.

  • _userauth.sign_up – A new endpoint completed the registration process in your app.

  • _userauth.auth_fail – The endpoint attempted to sign in to your app, but wasn't able to complete the process.

  • _monetization.purchase – The endpoint made a purchase in your app.

  • _session.pause – The endpoint's session was paused. Paused sessions can be resumed so that you can continue to collect metrics without starting an entirely new session.

  • _session.resume – The endpoint's session resumed.

event_timestamp

The time when the event was reported, shown as Unix time in milliseconds.

arrival_timestamp

The time when the event was received by Amazon Pinpoint, shown as Unix time in milliseconds.

event_version

The version of the event JSON schema.

Tip

Check this version in your event-processing application so that you know when to update the application in response to a schema update.

application

Information about the Amazon Pinpoint project that's associated with the event. See Application table for more information.

client

Information about the client that's installed on the device that reports the event. See the Client table for more information.

device

The device that reports the event. See the Device table for more information.

session

Information about the session that generated the event. See the Session table for more information.

attributes

Attributes that are associated with the event. For events that are reported by your apps, this object includes custom attributes that you define.

metrics Metrics that are related to the event. You can optionally configure your apps to send custom metrics to Amazon Pinpoint.

Application

Includes information about the Amazon Pinpoint project that the event is associated with.

Attribute Description
app_id

The unique ID of the Amazon Pinpoint project that reported the event.

cognito_identity_pool_id

The ID of the Amazon Cognito Identity Pool that the endpoint is associated with.

package_name

The name of your application package, such as com.example.my_app.

sdk

Information about the SDK that was used to report the event. See the SDK table for more information.

title

The name of your app.

version_name

The name of the version of the app, such as V2.5.

version_code

The version number of the app, such as 3.

SDK

Attribute Description
name The name of the SDK that was used to report the event.
version The version of the SDK.

Client

Includes information about the endpoint that the event is associated with.

Attribute Description
client_id The endpoint ID of the endpoint that the campaign was sent to.
cognito_id The Amazon Cognito ID token that's associated with the endpoint.

Device

Includes information about the device that the endpoint that generated the event is associated with.

Attribute Description
locale

Contains information about the language and region settings for the device. See the Locale table for more information.

make The manufacturer of the device that's associated with the endpoint.
model The model identifier of the device that's associated with the endpoint.
platform

Contains information about the operating system of the user's device. See the Platform table for more information.

Locale

Attribute Description
code The locale identifier that's associated with the device.
country The country or region that's associated with the device's locale.
language The language that's associated with the device's locale.

Platform

Attribute Description
name The name of the operating system on the user's device.
version The version of the device's operating system.

Session

Includes information about the session that generated the event.

Attribute Description
session_id

A unique ID that identifies the session.

start_timestamp

The date and time when the session began, shown as Unix time in milliseconds.

stop_timestamp

The date and time when the session ended, shown as Unix time in milliseconds.