public class GoogleAnalyticsConfig extends Object
new GoogleAnalyticsConfig().setMaxThreads(2).setThreadNameFormat("name");| Constructor and Description |
|---|
GoogleAnalyticsConfig() |
| Modifier and Type | Method and Description |
|---|---|
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() |
RequestParameterDiscoverer |
getRequestParameterDiscoverer() |
String |
getThreadNameFormat() |
String |
getUserAgent() |
boolean |
isDeriveSystemParameters()
Deprecated.
Use
isDiscoverRequestParameters() instead |
boolean |
isDiscoverRequestParameters() |
boolean |
isEnabled() |
boolean |
isGatherStats() |
boolean |
isUseHttps() |
boolean |
isValidate() |
static String |
mask(String value) |
GoogleAnalyticsConfig |
setDeriveSystemParameters(boolean deriveSystemProperties)
Deprecated.
Use
setDiscoverRequestParameters(boolean) instead |
GoogleAnalyticsConfig |
setDiscoverRequestParameters(boolean discoverSystemParameters)
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.
|
void |
setRequestParameterDiscoverer(RequestParameterDiscoverer requestParameterDiscoverer)
Sets the appropriate request parameter discoverer.
|
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() |
public RequestParameterDiscoverer getRequestParameterDiscoverer()
public void setRequestParameterDiscoverer(RequestParameterDiscoverer requestParameterDiscoverer)
DefaultRequestParameterDiscoverer but
can be changed to AwtRequestParameterDiscoverer if you want to use Toolkit to derive the screen resolution etc.
Please make sure you also enable the discovery using setDiscoverRequestParameters(boolean)requestParameterDiscoverer - can be null and is so, parameters will not be discovered.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)
threadNameFormat - non-null string for thread name.public String getThreadNameFormat()
@Deprecated public GoogleAnalyticsConfig setDeriveSystemParameters(boolean deriveSystemProperties)
setDiscoverRequestParameters(boolean) insteadpublic GoogleAnalyticsConfig setDiscoverRequestParameters(boolean discoverSystemParameters)
This is initialization level configuration (must be set while creating GoogleAnalytics object).
@Deprecated public boolean isDeriveSystemParameters()
isDiscoverRequestParameters() insteadpublic boolean isDiscoverRequestParameters()
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)
Default value is http://www.google-analytics.com/collect
This is request level configuration (can be changed any time).
public String getHttpsUrl()
public GoogleAnalyticsConfig setHttpsUrl(String httpsUrl)
Default value is https://ssl.google-analytics.com/collect
This is request level configuration (can be changed any time).
Copyright © Sep 2013–2015 H20.ai. All rights reserved.