public GoogleAnalyticsRequest(String hitType, String trackingId, String appName, String appVersion) { hitType(GaUtils.isBlank(hitType) ? Constants.HIT_PAGEVIEW : hitType); trackingId(trackingId); applicationName(appName); applicationVersion(appVersion); protocolVersion("1"); }
protected T setBoolean(GoogleAnalyticsParameter parameter, Boolean value) { if (value == null) { parms.remove(parameter); } else { String stringValue = fromBoolean(value); parms.put(parameter, stringValue); } return (T) this; }
protected T setDouble(GoogleAnalyticsParameter parameter, Double value) { if (value == null) { parms.remove(parameter); } else { String stringValue = fromDouble(value); parms.put(parameter, stringValue); } return (T) this; }
public Boolean javaEnabled() { return getBoolean(JAVA_ENABLED); }
public GoogleAnalyticsResponse send() { return execute(() -> delegateExecutor.post(this)); }
protected T setInteger(GoogleAnalyticsParameter parameter, Integer value) { if (value == null) { parms.remove(parameter); } else { String stringValue = fromInteger(value); parms.put(parameter, stringValue); } return (T) this; }
public Integer queueTime() { return getInteger(QUEUE_TIME); }
/** * Processes the custom dimensions and adds the values to list of parameters, which would be posted to GA. * * @param request * @param postParms */ protected void processCustomDimensionParameters(GoogleAnalyticsRequest<?> request, HttpRequest req) { Map<String, String> customDimParms = new HashMap<String, String>(); for (String defaultCustomDimKey : defaultRequest.customDimensions().keySet()) { customDimParms.put(defaultCustomDimKey, defaultRequest.customDimensions().get(defaultCustomDimKey)); } Map<String, String> requestCustomDims = request.customDimensions(); for (String requestCustomDimKey : requestCustomDims.keySet()) { customDimParms.put(requestCustomDimKey, requestCustomDims.get(requestCustomDimKey)); } for (String key : customDimParms.keySet()) { req.addBodyParam(key, customDimParms.get(key)); } }
/** * Processes the custom metrics and adds the values to list of parameters, which would be posted to GA. * * @param request * @param postParms */ protected void processCustomMetricParameters(GoogleAnalyticsRequest<?> request, HttpRequest req) { Map<String, String> customMetricParms = new HashMap<String, String>(); for (String defaultCustomMetricKey : defaultRequest.custommMetrics().keySet()) { customMetricParms.put(defaultCustomMetricKey, defaultRequest.custommMetrics().get(defaultCustomMetricKey)); } Map<String, String> requestCustomMetrics = request.custommMetrics(); for (String requestCustomDimKey : requestCustomMetrics.keySet()) { customMetricParms.put(requestCustomDimKey, requestCustomMetrics.get(requestCustomDimKey)); } for (String key : customMetricParms.keySet()) { req.addBodyParam(key, customMetricParms.get(key)); } }
public Boolean anonymizeIp() { return getBoolean(ANONYMIZE_IP); }
public Future<GoogleAnalyticsResponse> sendAsync() { return execute(() -> delegateExecutor.postAsync(this)); }
protected T setInteger(GoogleAnalyticsParameter parameter, Integer value) { if (value == null) { parms.remove(parameter); } else { String stringValue = fromInteger(value); parms.put(parameter, stringValue); } return (T) this; }
public Integer queueTime() { return getInteger(QUEUE_TIME); }
/** * Processes the custom dimensions and adds the values to list of parameters, which would be posted to GA. * * @param request * @param postParms */ protected void processCustomDimensionParameters(GoogleAnalyticsRequest<?> request, HttpRequest req) { Map<String, String> customDimParms = new HashMap<String, String>(); for (String defaultCustomDimKey : defaultRequest.customDimensions().keySet()) { customDimParms.put(defaultCustomDimKey, defaultRequest.customDimensions().get(defaultCustomDimKey)); } Map<String, String> requestCustomDims = request.customDimensions(); for (String requestCustomDimKey : requestCustomDims.keySet()) { customDimParms.put(requestCustomDimKey, requestCustomDims.get(requestCustomDimKey)); } for (String key : customDimParms.keySet()) { req.addBodyParam(key, customDimParms.get(key)); } }
/** * Processes the custom metrics and adds the values to list of parameters, which would be posted to GA. * * @param request * @param postParms */ protected void processCustomMetricParameters(GoogleAnalyticsRequest<?> request, HttpRequest req) { Map<String, String> customMetricParms = new HashMap<String, String>(); for (String defaultCustomMetricKey : defaultRequest.custommMetrics().keySet()) { customMetricParms.put(defaultCustomMetricKey, defaultRequest.custommMetrics().get(defaultCustomMetricKey)); } Map<String, String> requestCustomMetrics = request.custommMetrics(); for (String requestCustomDimKey : requestCustomMetrics.keySet()) { customMetricParms.put(requestCustomDimKey, requestCustomMetrics.get(requestCustomDimKey)); } for (String key : customMetricParms.keySet()) { req.addBodyParam(key, customMetricParms.get(key)); } }
public GoogleAnalyticsRequest(String hitType, String trackingId, String appName, String appVersion) { hitType(GaUtils.isBlank(hitType) ? Constants.HIT_PAGEVIEW : hitType); trackingId(trackingId); applicationName(appName); applicationVersion(appVersion); protocolVersion("1"); }
public Boolean javaEnabled() { return getBoolean(JAVA_ENABLED); }
public GoogleAnalyticsResponse send() { return execute(() -> delegateExecutor.post(this)); }
protected T setBoolean(GoogleAnalyticsParameter parameter, Boolean value) { if (value == null) { parms.remove(parameter); } else { String stringValue = fromBoolean(value); parms.put(parameter, stringValue); } return (T) this; }
protected T setDouble(GoogleAnalyticsParameter parameter, Double value) { if (value == null) { parms.remove(parameter); } else { String stringValue = fromDouble(value); parms.put(parameter, stringValue); } return (T) this; }