|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AnalyticsEvent
Represents the any useful action you wish to record within your application
The example below demonstrates how to record events.
// get the event client from your amazon MobileAnalyticsManager instance EventClient eventClient = mobileAnalyticsManager.getEventClient(); // create and record the view event Event level1CompleteEvent = eventClient.createEvent("level1Complete"); eventClient.recordEvent(level1CompleteEvent); // record if the user bought an upgrade (conversion) if (userBoughtUpgrade) { Event level1UserBoughtUpgradeEvent = eventClient.createEvent("level1UserBoughtUpgrade"); eventClient.recordEvent(level1UserBoughtUpgradeEvent); }
Method Summary | |
---|---|
void |
addAttribute(java.lang.String name,
java.lang.String value)
Adds an attribute to this AnalyticsEvent with the specified key. |
void |
addMetric(java.lang.String name,
java.lang.Double value)
Adds a metric to this AnalyticsEvent with the specified key. |
java.util.Map<java.lang.String,java.lang.String> |
getAllAttributes()
Returns a map of all attributes contained within this AnalyticsEvent |
java.util.Map<java.lang.String,java.lang.Double> |
getAllMetrics()
Returns a map of all metrics contained within this AnalyticsEvent |
java.lang.String |
getAttribute(java.lang.String name)
Returns the value of the attribute with the specified name. |
java.lang.String |
getEventType()
Returns the name/type of this AnalyticsEvent |
java.lang.Double |
getMetric(java.lang.String name)
Returns the value of the metric with the specified name. |
boolean |
hasAttribute(java.lang.String attributeName)
Determines if this AnalyticsEvent contains a specific attribute |
boolean |
hasMetric(java.lang.String metricName)
Determines if this AnalyticsEvent contains a specific metric. |
AnalyticsEvent |
withAttribute(java.lang.String name,
java.lang.String value)
Adds an attribute to this AnalyticsEvent with the specified key. |
AnalyticsEvent |
withMetric(java.lang.String name,
java.lang.Double value)
Adds a metric to this AnalyticsEvent with the specified key. |
Method Detail |
---|
void addAttribute(java.lang.String name, java.lang.String value)
AnalyticsEvent
with the specified key. Only 40 attributes/metrics
are allowed to be added to an Event. If 40 attribute/metrics already exist on this Event, the call may be ignored.
name
- The name of the attribute. The name will be truncated if it exceeds 50 characters.value
- The value of the attribute. The value will be truncated if it exceeds 200 characters.boolean hasAttribute(java.lang.String attributeName)
AnalyticsEvent
contains a specific attribute
attributeName
- The name of the attribute
AnalyticsEvent
has an attribute with the specified name, false otherwisevoid addMetric(java.lang.String name, java.lang.Double value)
AnalyticsEvent
with the specified key. Only 40 attributes/metrics
are allowed to be added to an Event. If 50 attribute/metrics already exist on this Event, the call may be ignored.
name
- The name of the metric. The name will be truncated if it exceeds 50 characters.value
- The value of the metric.boolean hasMetric(java.lang.String metricName)
AnalyticsEvent
contains a specific metric.
metricName
- The name of the metric
AnalyticsEvent
has a metric with the specified name, false otherwisejava.lang.String getEventType()
AnalyticsEvent
AnalyticsEvent
java.lang.String getAttribute(java.lang.String name)
name
- The name of the attribute to return
java.lang.Double getMetric(java.lang.String name)
name
- The name of the metric to return
AnalyticsEvent withAttribute(java.lang.String name, java.lang.String value)
AnalyticsEvent
with the specified key. Only 40 attributes/metrics
are allowed to be added to an AnalyticsEvent
. If 40 attribute/metrics already exist on this AnalyticsEvent
, the call may be ignored.
name
- The name of the attribute. The name will be truncated if it exceeds 50 characters.value
- The value of the attribute. The value will be truncated if it exceeds 200 characters.
AnalyticsEvent
instance is returned to allow for method chaining.AnalyticsEvent withMetric(java.lang.String name, java.lang.Double value)
AnalyticsEvent
with the specified key. Only 40 attributes/metrics
are allowed to be added to an AnalyticsEvent
. If 40 attribute/metrics already exist on this AnalyticsEvent
, the call may be ignored.
name
- The name of the metric. The name will be truncated if it exceeds 50 characters.value
- The value of the metric.
AnalyticsEvent
instance is returned to allow for method chaining.java.util.Map<java.lang.String,java.lang.String> getAllAttributes()
AnalyticsEvent
java.util.Map<java.lang.String,java.lang.Double> getAllMetrics()
AnalyticsEvent
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |