public class GoogleAnalyticsImpl extends Object implements GoogleAnalytics
GoogleAnalytics implementation that uses JSNI to
expose Google Analytics javascript methods.| Constructor and Description |
|---|
GoogleAnalyticsImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAccount(String trackerName,
String userAccount)
Given that you already have initialized your default Google account with
GoogleAnalytics.init(String), this function will add a new account on which you'll
be able to track events and pages. |
void |
init(String userAccount)
Initializes the script for Google Analytics for a specific userAccount.
|
void |
trackEvent(String category,
String action)
Tracks an event in Google analytics.
|
void |
trackEvent(String category,
String action,
String optLabel)
Tracks an event in Google analytics, attaching a label and value.
|
void |
trackEvent(String category,
String action,
String optLabel,
int optValue)
Tracks an event in Google analytics, attaching a label and value.
|
void |
trackEvent(String category,
String action,
String optLabel,
int optValue,
boolean optNonInteraction)
Tracks an event in Google analytics, attaching a label and value.
|
void |
trackEventWithTracker(String trackerName,
String category,
String action)
Tracks an event in Google analytics on a user defined tracker name.
|
void |
trackEventWithTracker(String trackerName,
String category,
String action,
String optLabel)
Tracks an event in Google analytics, attaching a label and value on a user
defined tracker name.
|
void |
trackEventWithTracker(String trackerName,
String category,
String action,
String optLabel,
int optValue)
Tracks an event in Google analytics, attaching a label and value on a user
defined tracker name.
|
void |
trackEventWithTracker(String trackerName,
String category,
String action,
String optLabel,
int optValue,
boolean optNonInteraction)
Tracks an event in Google analytics, attaching a label and value on a user
defined tracker name.
|
void |
trackPageview()
Tracks the root of your application.
|
void |
trackPageview(String pageName)
Tracks a page given a specific page name.
|
void |
trackPageview(String trackerName,
String pageName)
Tracks a page given a specific page name on a user defined tracker
name.
|
public void init(String userAccount)
GoogleAnalyticsinit in interface GoogleAnalyticsuserAccount - The Google Analytics account. (i.e. UA-12345678-1)public void addAccount(String trackerName, String userAccount)
GoogleAnalyticsGoogleAnalytics.init(String), this function will add a new account on which you'll
be able to track events and pages.addAccount in interface GoogleAnalyticstrackerName - A user-defined tracker name.userAccount - The Google Analytics account. (i.e. UA-12345678-1)public void trackPageview(String pageName)
GoogleAnalyticstrackPageview in interface GoogleAnalyticspageName - The page name to track.public void trackPageview()
GoogleAnalyticstrackPageview in interface GoogleAnalyticspublic void trackPageview(String trackerName, String pageName)
GoogleAnalyticsGoogleAnalytics.addAccount(String, String).trackPageview in interface GoogleAnalyticstrackerName - A user defined tracker name.pageName - The page name to track.public void trackEvent(String category, String action)
GoogleAnalyticstrackEvent in interface GoogleAnalyticscategory - The name you supply for the group of objects you want to
track.action - A string that is uniquely paired with each category, and
commonly used to define the type of user interaction for the web
object.public void trackEvent(String category, String action, String optLabel)
GoogleAnalyticstrackEvent in interface GoogleAnalyticscategory - The name you supply for the group of objects you want to
track.action - A string that is uniquely paired with each category, and
commonly used to define the type of user interaction for the web
object.optLabel - An string to provide additional dimensions to the event
data.public void trackEvent(String category, String action, String optLabel, int optValue)
GoogleAnalyticstrackEvent in interface GoogleAnalyticscategory - The name you supply for the group of objects you want to
track.action - A string that is uniquely paired with each category, and
commonly used to define the type of user interaction for the web
object.optLabel - An string to provide additional dimensions to the event
data.optValue - An integer that you can use to provide numerical data about
the user event.public void trackEvent(String category, String action, String optLabel, int optValue, boolean optNonInteraction)
GoogleAnalyticstrackEvent in interface GoogleAnalyticscategory - The name you supply for the group of objects you want to
track.action - A string that is uniquely paired with each category, and
commonly used to define the type of user interaction for the web
object.optLabel - An string to provide additional dimensions to the event
data.optValue - An integer that you can use to provide numerical data about
the user event.optNonInteraction - A boolean that when set to true, indicates that the event hit
will not be used in bounce-rate calculation.public void trackEventWithTracker(String trackerName, String category, String action)
GoogleAnalyticsGoogleAnalytics.addAccount(String, String).trackEventWithTracker in interface GoogleAnalyticscategory - The name you supply for the group of objects you want to
track.action - A string that is uniquely paired with each category, and
commonly used to define the type of user interaction for the web
object.public void trackEventWithTracker(String trackerName, String category, String action, String optLabel)
GoogleAnalyticsGoogleAnalytics.addAccount(String, String).trackEventWithTracker in interface GoogleAnalyticscategory - The name you supply for the group of objects you want to
track.action - A string that is uniquely paired with each category, and
commonly used to define the type of user interaction for the web
object.optLabel - An string to provide additional dimensions to the event
data.public void trackEventWithTracker(String trackerName, String category, String action, String optLabel, int optValue)
GoogleAnalyticsGoogleAnalytics.addAccount(String, String).trackEventWithTracker in interface GoogleAnalyticscategory - The name you supply for the group of objects you want to
track.action - A string that is uniquely paired with each category, and
commonly used to define the type of user interaction for the web
object.optLabel - An string to provide additional dimensions to the event
data.optValue - An integer that you can use to provide numerical data about
the user event.public void trackEventWithTracker(String trackerName, String category, String action, String optLabel, int optValue, boolean optNonInteraction)
GoogleAnalyticsGoogleAnalytics.addAccount(String, String).trackEventWithTracker in interface GoogleAnalyticscategory - The name you supply for the group of objects you want to
track.action - A string that is uniquely paired with each category, and
commonly used to define the type of user interaction for the web
object.optLabel - An string to provide additional dimensions to the event
data.optValue - An integer that you can use to provide numerical data about
the user event.optNonInteraction - A boolean that when set to true, indicates that the event hit
will not be used in bounce-rate calculation.Copyright © 2010–2014 Arcbees. All rights reserved.