public class GoogleAnalytics extends Object
GoogleAnalyticsConfig and DefaultRequest.
Configuration contains sensible defaults so one could just initialize using one of the convenience constructors.
This object is ThreadSafe and it is intended that clients create one instance of this for each GA Tracker Id
and reuse each time an event needs to be posted.
This object contains resources which needs to be shutdown/disposed. So close() method is called
to release all resources. Once close method is called, this instance cannot be reused so create new instance
if required.| Constructor and Description |
|---|
GoogleAnalytics(GoogleAnalyticsConfig config,
DefaultRequest defaultRequest) |
GoogleAnalytics(GoogleAnalyticsConfig config,
String trackingId) |
GoogleAnalytics(GoogleAnalyticsConfig config,
String trackingId,
String appName,
String appVersion) |
GoogleAnalytics(String trackingId) |
GoogleAnalytics(String trackingId,
String appName,
String appVersion) |
public GoogleAnalytics(String trackingId)
public GoogleAnalytics(GoogleAnalyticsConfig config, String trackingId)
public GoogleAnalytics(GoogleAnalyticsConfig config, String trackingId, String appName, String appVersion)
public GoogleAnalytics(GoogleAnalyticsConfig config, DefaultRequest defaultRequest)
public GoogleAnalyticsConfig getConfig()
public org.apache.http.client.HttpClient getHttpClient()
public DefaultRequest getDefaultRequest()
public void setDefaultRequest(DefaultRequest request)
public void setHttpClient(org.apache.http.impl.client.CloseableHttpClient httpClient)
public GoogleAnalyticsResponse post(GoogleAnalyticsRequest request)
public Future<GoogleAnalyticsResponse> postAsync(RequestProvider requestProvider)
public Future<GoogleAnalyticsResponse> postAsync(GoogleAnalyticsRequest request)
public void close()
protected DefaultRequest deriveSystemParameters(GoogleAnalyticsConfig config, DefaultRequest request)
protected org.apache.http.impl.client.CloseableHttpClient createHttpClient(GoogleAnalyticsConfig config)
protected int getDefaultMaxPerRoute(GoogleAnalyticsConfig config)
protected ThreadPoolExecutor getExecutor()
protected ThreadPoolExecutor createExecutor(GoogleAnalyticsConfig config)
protected String getUserAgentString()
protected void appendProperty(StringBuilder sb, String property)
protected ThreadFactory createThreadFactory()
public GoogleAnalyticsStats getStats()
public void resetStats()
Copyright © Sep 2013–2014 brsanthu Inc. All rights reserved.