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)
GoogleAnalytics
init
in interface GoogleAnalytics
userAccount
- The Google Analytics account. (i.e. UA-12345678-1
)public void addAccount(String trackerName, String userAccount)
GoogleAnalytics
GoogleAnalytics.init(String)
, this function will add a new account on which you'll
be able to track events and pages.addAccount
in interface GoogleAnalytics
trackerName
- A user-defined tracker name.userAccount
- The Google Analytics account. (i.e. UA-12345678-1
)public void trackPageview(String pageName)
GoogleAnalytics
trackPageview
in interface GoogleAnalytics
pageName
- The page name to track.public void trackPageview()
GoogleAnalytics
trackPageview
in interface GoogleAnalytics
public void trackPageview(String trackerName, String pageName)
GoogleAnalytics
GoogleAnalytics.addAccount(String, String)
.trackPageview
in interface GoogleAnalytics
trackerName
- A user defined tracker name.pageName
- The page name to track.public void trackEvent(String category, String action)
GoogleAnalytics
trackEvent
in interface GoogleAnalytics
category
- 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)
GoogleAnalytics
trackEvent
in interface GoogleAnalytics
category
- 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)
GoogleAnalytics
trackEvent
in interface GoogleAnalytics
category
- 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)
GoogleAnalytics
trackEvent
in interface GoogleAnalytics
category
- 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)
GoogleAnalytics
GoogleAnalytics.addAccount(String, String)
.trackEventWithTracker
in interface GoogleAnalytics
category
- 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)
GoogleAnalytics
GoogleAnalytics.addAccount(String, String)
.trackEventWithTracker
in interface GoogleAnalytics
category
- 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)
GoogleAnalytics
GoogleAnalytics.addAccount(String, String)
.trackEventWithTracker
in interface GoogleAnalytics
category
- 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)
GoogleAnalytics
GoogleAnalytics.addAccount(String, String)
.trackEventWithTracker
in interface GoogleAnalytics
category
- 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.