java.lang.Object | ||
↳ | com.urbanairship.AirshipComponent | |
↳ | com.urbanairship.analytics.Analytics |
This class is the primary interface to the Airship Analytics API.
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.urbanairship.AirshipComponent
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Analytics(Context context, PreferenceDataStore dataStore, AirshipRuntimeConfig runtimeConfig, PrivacyManager privacyManager, AirshipChannel channel, LocaleManager localeManager, PermissionsManager permissionsManager) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
addAnalyticsListener(AnalyticsListener analyticsListener)
Adds an
AnalyticsListener for analytics events. | ||||||||||
void |
addEvent(Event event)
Adds an analytics event.
| ||||||||||
AssociatedIdentifiers.Editor |
editAssociatedIdentifiers()
Edits the currently stored associated identifiers.
| ||||||||||
AssociatedIdentifiers |
getAssociatedIdentifiers()
Returns the device's current associated identifiers.
| ||||||||||
String |
getConversionSendId()
Returns the last stored send Id from when a push conversion was detected.
| ||||||||||
String |
getSessionId()
Gets the current environment Id.
| ||||||||||
boolean |
isAppInForeground()
Determines if the application is in the foreground.
| ||||||||||
boolean | isEnabled() | ||||||||||
void |
removeAnalyticsListener(AnalyticsListener analyticsListener)
Removes an
AnalyticsListener for analytics events. | ||||||||||
void |
setEnabled(boolean enabled)
This method is deprecated.
Enable/disable by enabling
FEATURE_ANALYTICS in PrivacyManager .
This will call through to the privacy manager.
| ||||||||||
void |
trackScreen(String screen)
Initiates screen tracking for a specific app screen, must be called once per tracked screen.
| ||||||||||
void |
uploadEvents()
Uploads any pending events.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
init()
Initialize the manager.
| ||||||||||
void |
tearDown()
Tear down the manager.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Adds an AnalyticsListener
for analytics events.
analyticsListener | The AnalyticsListener .
|
---|
Adds an analytics event.
event | The event to be triggered. |
---|
Edits the currently stored associated identifiers. All changes made in the editor are batched,
and not stored until you call apply(). Calling apply() on the editor will associate the
identifiers with the device and add an event that will be sent up with other analytics
events. See AssociatedIdentifiers.Editor
Returns the device's current associated identifiers.
Returns the last stored send Id from when a push conversion was detected.
Determines if the application is in the foreground.
true
if the application is in the foreground, otherwise
false
.
Returns true
if analyticsEnabled
is set to true
, and FEATURE_ANALYTICS
is enabled, otherwise false
.
Features that depend on analytics being enabled may not work properly if it's disabled (reports, region triggers, location segmentation, push to local time).
true
if analytics is enabled, otherwise false
.
Removes an AnalyticsListener
for analytics events.
analyticsListener | The AnalyticsListener .
|
---|
This method is deprecated.
Enable/disable by enabling FEATURE_ANALYTICS
in PrivacyManager
.
This will call through to the privacy manager.
Sets analytics enabled. When disabling analytics, any locally stored events will be deleted.
Features that depend on analytics being enabled may not work properly if it's disabled (reports, region triggers, location segmentation, push to local time).
enabled | true to enable analytics, false to disable. |
---|
Initiates screen tracking for a specific app screen, must be called once per tracked screen.
screen | The screen's string identifier. |
---|
Uploads any pending events. Events are batched and uploaded automatically to conserve battery life. Normally apps should not call this method directly.