com.google.analytics.tracking.android
Interface Analytics

All Known Implementing Classes:
GoogleAnalytics

public interface Analytics

Defines the interface for doing Analytics.


Nested Class Summary
static interface Analytics.AppOptOutCallback
          Interface for retrieving the current state of the Application-level opt out flag.
 
Method Summary
 boolean debugEnabled()
          Returns whether debug mode is on.
 Tracker getDefaultTracker()
          Returns the default Tracker if one exists.
 Tracker getTracker(java.lang.String trackingId)
          Multiple instances of a Tracker can be created as long as each has its own trackingId.
 void requestAppOptOut(Analytics.AppOptOutCallback callback)
          Requests whether the state of the application-level opt is on.
 void setAppOptOut(boolean optOut)
          Sets or resets the application-level opt out flag.
 void setDebug(boolean debug)
          Toggles debug mode.
 void setDefaultTracker(Tracker tracker)
          Sets the default Tracker.
 

Method Detail

setDebug

void setDebug(boolean debug)
Toggles debug mode. In debug mode, debug messages will be written to the log. This is useful for debugging calls to the Google Analytics SDK.

By default, this flag is disabled.


debugEnabled

boolean debugEnabled()
Returns whether debug mode is on.


getTracker

Tracker getTracker(java.lang.String trackingId)
Multiple instances of a Tracker can be created as long as each has its own trackingId. If a Tracker has already been created (and not yet closed) for a given trackingId, that will be returned.

Parameters:
trackingId - string of the form UA-xxxx-y

getDefaultTracker

Tracker getDefaultTracker()
Returns the default Tracker if one exists. By default, the default Tracker is the first one created.


setDefaultTracker

void setDefaultTracker(Tracker tracker)
Sets the default Tracker.


setAppOptOut

void setAppOptOut(boolean optOut)
Sets or resets the application-level opt out flag. If set, no hits will be sent to Google Analytics. The value of this flag will persist across app starts.

Parameters:
optOut - true if application-level opt out should be enforced

requestAppOptOut

void requestAppOptOut(Analytics.AppOptOutCallback callback)
Requests whether the state of the application-level opt is on. The Analytics.AppOptOutCallback.reportAppOptOut(boolean) method will be called with the answer once it's been calculated. The callback Analytics.AppOptOutCallback.reportAppOptOut(boolean) may be called either before or after this method returns.

It may be called from a different thread.

Parameters:
callback - to use to report application-level opt out flag