Menu
Amazon Mobile Analytics
User Guide

Adding Attributes and Metrics

Before you add attributes or metrics to events in your app, you must:

Reporting Detailed Data Points

You specify individual data values sent to Mobile Analytics by adding one or more attributes or metrics to an event before you submit it. An event can include any combination of up to 40 total attributes and metrics.

As a best practice, we recommend that names given to custom event names be broad and those given to attributes or metrics be specific. For example, using "Item Bought" instead of "Item XYZ" as the custom event name helps keep the report from having too many distinct event names that are hard to read and aggregate.

Adding Attributes

Attributes are data that provide context for the submitted event. For example, a game that submits an event to Mobile Analytics when the player collects a power-up bonus might include an attribute named for the type of bonus collected.

You add attributes to an event as a collection of key-value pairs. When you use the REST API, you add each key-value pair to the attributes section of the event and then submit the event with the PutEvents action. For example:

Copy
"attributes": { "bonusType": "Bonus Avatar", "bonusSelection": "Spaceman" }

Adding Metrics

Metrics are data that provides measurable context to the event. For example, a photo-sharing app that submits an event when selected photos are uploaded might include a metric for the total amount of data being uploaded, in megabytes.

You add metrics to an event as a collection of key-value pairs. When you use the REST API, you add each key-value pair to the metrics section of the event and then submit the event with the PutEvents action. For example:

Copy
"metrics": { "finishedLevel": "3", "totalCoins": "135500" }