public class AnalyticsService extends Object
Constructor and Description |
---|
AnalyticsService() |
Modifier and Type | Method and Description |
---|---|
static void |
init(AnalyticsService i)
Allows installing an analytics service other than the default
|
static void |
init(String agent,
String domain)
Initializes google analytics for this application
|
protected boolean |
isAnalyticsEnabled()
Indicates if the analytics is enabled, subclasses must override this method to process their information
|
static boolean |
isAppsMode()
Apps mode allows improved analytics using the newer google analytics API designed for apps
|
static boolean |
isEnabled()
Indicates whether analytics is enabled for this application
|
static boolean |
isFailSilently()
Indicates whether analytics server failures should brodcast an error event
|
static void |
sendCrashReport(Throwable t,
String message,
boolean fatal)
In apps mode we can send information about an exception to the analytics server
|
static void |
setAppsMode(boolean aAppsMode)
Apps mode allows improved analytics using the newer google analytics API designed for apps
|
static void |
setFailSilently(boolean aFailSilently)
Indicates whether analytics server failures should brodcast an error event
|
static void |
visit(String page,
String referer)
Sends an asynchronous notice to the server regarding a page in the application being viewed, notice that
you don't need to append the URL prefix to the page string.
|
protected void |
visitPage(String page,
String referer)
Subclasses should override this method to track page visits
|
public static boolean isFailSilently()
public static void setFailSilently(boolean aFailSilently)
aFailSilently
- the failSilently to setpublic static boolean isAppsMode()
public static void setAppsMode(boolean aAppsMode)
aAppsMode
- the appsMode to setpublic static boolean isEnabled()
protected boolean isAnalyticsEnabled()
public static void init(String agent, String domain)
agent
- the google analytics tracking agentdomain
- a domain to represent your application, commonly you should use your package name as a URL (e.g.
com.mycompany.myapp should become: myapp.mycompany.com)public static void init(AnalyticsService i)
i
- the analytics service implementation.public static void visit(String page, String referer)
page
- the page viewedreferer
- the source pageprotected void visitPage(String page, String referer)
page
- the page visitedreferer
- the page from which the user came