public interface GoogleAnalytics
ga.js
tracking code that
you can use to record user interaction with website elements. This is
accomplished by attaching the method call to the particular UI element you
want to track. When used this way, all user activity on such elements is
calculated and displayed as Events in the Analytics reporting interface.
Additionally, pageview calculations are unaffected by user activity tracked
using the Event Tracking method. Finally, Event Tracking employs an
object-oriented model that you can use to collect and classify different
types of interaction with your web page objects.
Inject this interface in your presenters when you need to interact with the
Google Analytics module, for example to log your custom event. You can
also configure automatic registration of navigation event using
GoogleAnalyticsNavigationTracker
.
Also, for more information about Event Tracking, please read:
Event Tracking GuideModifier and Type | Method and Description |
---|---|
void |
addAccount(String trackerName,
String userAccount)
Given that you already have initialized your default Google account with
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.
|
void init(String userAccount)
userAccount
- The Google Analytics account. (i.e. UA-12345678-1
)void addAccount(String trackerName, String userAccount)
init(String)
, this function will add a new account on which you'll
be able to track events and pages.trackerName
- A user-defined tracker name.userAccount
- The Google Analytics account. (i.e. UA-12345678-1
)void trackPageview()
void trackPageview(String pageName)
pageName
- The page name to track.void trackPageview(String trackerName, String pageName)
addAccount(String, String)
.trackerName
- A user defined tracker name.pageName
- The page name to track.void trackEvent(String category, String action)
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.void trackEventWithTracker(String trackerName, String category, String action)
addAccount(String, String)
.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.void trackEvent(String category, String action, String optLabel)
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.void trackEventWithTracker(String trackerName, String category, String action, String optLabel)
addAccount(String, String)
.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.void trackEvent(String category, String action, String optLabel, int optValue)
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.void trackEventWithTracker(String trackerName, String category, String action, String optLabel, int optValue)
addAccount(String, String)
.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.void trackEvent(String category, String action, String optLabel, int optValue, boolean optNonInteraction)
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.void trackEventWithTracker(String trackerName, String category, String action, String optLabel, int optValue, boolean optNonInteraction)
addAccount(String, String)
.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.