/** * @deprecated Use {@link #customDimension(int)} instead */ public String customDimention(int index) { return customDimension(index); }
public GoogleAnalyticsRequest(String hitType, String trackingId, String appName, String appVersion) { hitType(isEmpty(hitType) ? "pageview" : hitType); trackingId(trackingId); applicationName(appName); applicationVersion(appVersion); protocolVersion("1"); }
/** * @deprecated Use {@link #customDimensions()} instead */ public Map<String, String> customDimentions() { return customDimensions(); }
private void enrich(GoogleAnalyticsRequest request) { request.clientId(SettingsComponent.getInstance().getUserId()); request.dataSource("plugin"); request.customDimension(1, applicationInfo.getBuild().getProductCode()); // jetbrainsProductCode request.customDimension(2, applicationInfo.getBuild().asStringWithoutProductCode()); // jetbrainsBuildNumber request.customDimension(3, applicationInfo.getFullVersion()); // jetbrainsProductVersion request.customDimension(4, String.valueOf(PluginUtil.isEnabled())); // pluginEnabled request.customDimension(5, PluginUtil.getVersion()); // pluginVersion request.customDimension(6, String.valueOf(GraphConstants.IS_DEVELOPMENT)); // pluginDevelopmentMode }
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; }
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; }
/** * Processes the custom metrics and adds the values to list of parameters, which would be posted to GA. * * @param request * @param postParms */ private void processCustomMetricParameters(@SuppressWarnings("rawtypes") GoogleAnalyticsRequest request, List<NameValuePair> postParms) { Map<String, String> customMetricParms = new HashMap<String, String>(); for (String defaultCustomMetricKey : defaultRequest.custommMetrics().keySet()) { customMetricParms.put(defaultCustomMetricKey, defaultRequest.custommMetrics().get(defaultCustomMetricKey)); } @SuppressWarnings("unchecked") Map<String, String> requestCustomMetrics = request.custommMetrics(); for (String requestCustomDimKey : requestCustomMetrics.keySet()) { customMetricParms.put(requestCustomDimKey, requestCustomMetrics.get(requestCustomDimKey)); } for (String key : customMetricParms.keySet()) { postParms.add(new BasicNameValuePair(key, customMetricParms.get(key))); } }
/** * @deprecated Use {@link #customDimension(int, String)} instead */ public T customDimention(int index, String value) { return customDimension(index, value); }
/** * Processes the custom dimensions and adds the values to list of parameters, which would be posted to GA. * * @param request * @param postParms */ private void processCustomDimensionParameters(@SuppressWarnings("rawtypes") GoogleAnalyticsRequest request, List<NameValuePair> postParms) { Map<String, String> customDimParms = new HashMap<String, String>(); for (String defaultCustomDimKey : defaultRequest.customDimensions().keySet()) { customDimParms.put(defaultCustomDimKey, defaultRequest.customDimensions().get(defaultCustomDimKey)); } @SuppressWarnings("unchecked") Map<String, String> requestCustomDims = request.customDimensions(); for (String requestCustomDimKey : requestCustomDims.keySet()) { customDimParms.put(requestCustomDimKey, requestCustomDims.get(requestCustomDimKey)); } for (String key : customDimParms.keySet()) { postParms.add(new BasicNameValuePair(key, customDimParms.get(key))); } }