|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.brsanthu.googleanalytics.GoogleAnalyticsConfig
public class GoogleAnalyticsConfig
Properties that can be configured in this library. These would include any properties that are required to process the tracking request or enhance the tracking request (but not specified in measurement protocol like User agent).
Most of the properties are initialization level and request level. If a property is a initialization level property, it should be set at the time of GoogleAnalytics object initialization. If a property is a request level property, it can be set any time and it will be effective.
All properties of this config object supports method chaining. So for example, you could do,
new GoogleAnalyticsConfig().setMaxThreads(2).setThreadNameFormat("name");
Constructor Summary | |
---|---|
GoogleAnalyticsConfig()
|
Method Summary | |
---|---|
String |
getHttpsUrl()
|
String |
getHttpUrl()
|
int |
getMaxThreads()
Maximum threads to use to process the asynchronous event posting and Http client connection pooling. |
String |
getProxyHost()
|
String |
getProxyPassword()
|
int |
getProxyPort()
|
String |
getProxyUserName()
|
String |
getThreadNameFormat()
|
String |
getUserAgent()
|
boolean |
isDeriveSystemParameters()
|
boolean |
isEnabled()
|
boolean |
isGatherStats()
|
boolean |
isUseHttps()
|
boolean |
isValidate()
|
static String |
mask(String value)
|
GoogleAnalyticsConfig |
setDeriveSystemParameters(boolean deriveSystemProperties)
If true, derives the system properties (User Language, Region, Country, Screen Size, Color Depth, and File encoding) and adds to the default request. |
GoogleAnalyticsConfig |
setEnabled(boolean enabled)
Enables or disables the GoogleAnalytics posting. |
void |
setGatherStats(boolean gatherStats)
If set to true, GoogleAnalytics will collect the basic stats about successful event postings
for various hit types and keeps a copy of GoogleAnalyticsStats , which can be retrieved
using GoogleAnalytics.getStats() |
GoogleAnalyticsConfig |
setHttpsUrl(String httpsUrl)
URL to use when posting the event in https mode. |
GoogleAnalyticsConfig |
setHttpUrl(String httpUrl)
URL to use when posting the event in http mode. |
GoogleAnalyticsConfig |
setMaxThreads(int maxThreads)
|
GoogleAnalyticsConfig |
setProxyHost(String proxyHost)
Sets the host name of the proxy server, to connect to Google analytics. |
GoogleAnalyticsConfig |
setProxyPassword(String proxyPassword)
Sets the password which should be used to authenticate to the proxy server. |
GoogleAnalyticsConfig |
setProxyPort(int proxyPort)
Sets the host name of the proxy server, to connect to Google analytics. |
GoogleAnalyticsConfig |
setProxyUserName(String proxyUserName)
Sets the user name which should be used to authenticate to the proxy server. |
GoogleAnalyticsConfig |
setThreadNameFormat(String threadNameFormat)
Sets the thread name format that should be while creating the threads. |
GoogleAnalyticsConfig |
setUseHttps(boolean useHttps)
Instructs to use https url to send the events. |
GoogleAnalyticsConfig |
setUserAgent(String userAgent)
Sets the user agent string that should be sent while making the http request. |
GoogleAnalyticsConfig |
setValidate(boolean validate)
If set, validates the request before sending to Google Analytics. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GoogleAnalyticsConfig()
Method Detail |
---|
public boolean isGatherStats()
public void setGatherStats(boolean gatherStats)
GoogleAnalytics
will collect the basic stats about successful event postings
for various hit types and keeps a copy of GoogleAnalyticsStats
, which can be retrieved
using GoogleAnalytics.getStats()
gatherStats
- public GoogleAnalyticsConfig setThreadNameFormat(String threadNameFormat)
Default is "googleanalytics-thread-{0}" where {0} is the thread counter. If you specify a custom format, make sure {0} is there somewhere otherwise all threads will be nameed same and can be an issue for troubleshooting.
threadNameFormat
- non-null string for thread name.public String getThreadNameFormat()
public GoogleAnalyticsConfig setDeriveSystemParameters(boolean deriveSystemProperties)
This is initialization level configuration (must be set while creating GoogleAnalytics object).
public boolean isDeriveSystemParameters()
public GoogleAnalyticsConfig setProxyUserName(String proxyUserName)
setProxyHost(String)
is not empty.
This is initialization level configuration (must be set while creating GoogleAnalytics object).
public String getProxyUserName()
public String getProxyPassword()
public GoogleAnalyticsConfig setProxyPassword(String proxyPassword)
setProxyHost(String)
and setProxyUserName(String)
is not empty.
This is initialization level configuration (must be set while creating GoogleAnalytics object).
public String getProxyHost()
public GoogleAnalyticsConfig setProxyHost(String proxyHost)
This is initialization level configuration (must be set while creating GoogleAnalytics object).
public int getProxyPort()
public GoogleAnalyticsConfig setProxyPort(int proxyPort)
This is initialization level configuration (must be set while creating GoogleAnalytics object).
public String getUserAgent()
public GoogleAnalyticsConfig setUserAgent(String userAgent)
Apache-HttpClient/release (java 1.5)
This is initialization level configuration (must be set while creating GoogleAnalytics object).
public boolean isEnabled()
public GoogleAnalyticsConfig setEnabled(boolean enabled)
false
.
This is request level configuration (can be changed any time).
public int getMaxThreads()
This is initialization level configuration (must be set while creating GoogleAnalytics object).
public GoogleAnalyticsConfig setMaxThreads(int maxThreads)
public boolean isUseHttps()
public GoogleAnalyticsConfig setUseHttps(boolean useHttps)
This is request level configuration (can be changed any time).
public boolean isValidate()
public GoogleAnalyticsConfig setValidate(boolean validate)
This is request level configuration (can be changed any time).
public String getHttpUrl()
public GoogleAnalyticsConfig setHttpUrl(String httpUrl)
This is request level configuration (can be changed any time).
public String getHttpsUrl()
public GoogleAnalyticsConfig setHttpsUrl(String httpsUrl)
This is request level configuration (can be changed any time).
public String toString()
toString
in class Object
public static String mask(String value)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |