All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.brsanthu.googleanalytics.TimingHit Maven / Gradle / Ivy

Go to download

This is Java API for Google Analytics (Measurement Protocol). More information about the protocol is available at https://developers.google.com/analytics/devguides/collection/protocol/v1/.

There is a newer version: 2.0.0
Show newest version
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.brsanthu.googleanalytics;

import static com.brsanthu.googleanalytics.GoogleAnalyticsParameter.DNS_TIME;
import static com.brsanthu.googleanalytics.GoogleAnalyticsParameter.PAGE_DOWNLOAD_TIME;
import static com.brsanthu.googleanalytics.GoogleAnalyticsParameter.PAGE_LOAD_TIME;
import static com.brsanthu.googleanalytics.GoogleAnalyticsParameter.REDIRECT_RESPONSE_TIME;
import static com.brsanthu.googleanalytics.GoogleAnalyticsParameter.SERVER_RESPONSE_TIME;
import static com.brsanthu.googleanalytics.GoogleAnalyticsParameter.TCP_CONNECT_TIME;
import static com.brsanthu.googleanalytics.GoogleAnalyticsParameter.USER_TIMING_CATEGORY;
import static com.brsanthu.googleanalytics.GoogleAnalyticsParameter.USER_TIMING_LABEL;
import static com.brsanthu.googleanalytics.GoogleAnalyticsParameter.USER_TIMING_TIME;
import static com.brsanthu.googleanalytics.GoogleAnalyticsParameter.USER_TIMING_VARIABLE_NAME;

/**
 * GA request to track performance timings like page load time, server response time etc.
 *
 * 

For more information, see GA Parameters Reference

* * @author Santhosh Kumar */ public class TimingHit extends GoogleAnalyticsRequest { public TimingHit() { super("timing"); } /** *
*

* Optional. *

*

Specifies the user timing category.

* * * * * * * * * * * * * * * * * *
ParameterValue TypeDefault ValueMax LengthSupported Hit Types
utctextNone * 150 Bytes * timing
*
* Example value: category
* Example usage: utc=category *
*
*/ public TimingHit userTimingCategory(String value) { setString(USER_TIMING_CATEGORY, value); return this; } public String userTimingCategory() { return getString(USER_TIMING_CATEGORY); } /** *
*

* Optional. *

*

Specifies the user timing variable.

* * * * * * * * * * * * * * * * * *
ParameterValue TypeDefault ValueMax LengthSupported Hit Types
utvtextNone * 500 Bytes * timing
*
* Example value: lookup
* Example usage: utv=lookup *
*
*/ public TimingHit userTimingVariableName(String value) { setString(USER_TIMING_VARIABLE_NAME, value); return this; } public String userTimingVariableName() { return getString(USER_TIMING_VARIABLE_NAME); } /** *
*

* Optional. *

*

Specifies the user timing value. The value is in milliseconds.

* * * * * * * * * * * * * * * * * *
ParameterValue TypeDefault ValueMax LengthSupported Hit Types
uttintegerNone * None * timing
*
* Example value: 123
* Example usage: utt=123 *
*
*/ public TimingHit userTimingTime(Integer value) { setInteger(USER_TIMING_TIME, value); return this; } public Integer userTimingTime() { return getInteger(USER_TIMING_TIME); } /** *
*

* Optional. *

*

Specifies the user timing label.

* * * * * * * * * * * * * * * * * *
ParameterValue TypeDefault ValueMax LengthSupported Hit Types
utltextNone * 500 Bytes * timing
*
* Example value: label
* Example usage: utl=label *
*
*/ public TimingHit userTimingLabel(String value) { setString(USER_TIMING_LABEL, value); return this; } public String userTimingLabel() { return getString(USER_TIMING_LABEL); } /** *
*

* Optional. *

*

Specifies the time it took for a page to load. The value is in milliseconds.

* * * * * * * * * * * * * * * * * *
ParameterValue TypeDefault ValueMax LengthSupported Hit Types
pltintegerNone * None * timing
*
* Example value: 3554
* Example usage: plt=3554 *
*
*/ public TimingHit pageLoadTime(Integer value) { setInteger(PAGE_LOAD_TIME, value); return this; } public Integer pageLoadTime() { return getInteger(PAGE_LOAD_TIME); } /** *
*

* Optional. *

*

Specifies the time it took to do a DNS lookup.The value is in milliseconds.

* * * * * * * * * * * * * * * * * *
ParameterValue TypeDefault ValueMax LengthSupported Hit Types
dnsintegerNone * None * timing
*
* Example value: 43
* Example usage: dns=43 *
*
*/ public TimingHit dnsTime(Integer value) { setInteger(DNS_TIME, value); return this; } public Integer dnsTime() { return getInteger(DNS_TIME); } /** *
*

* Optional. *

*

Specifies the time it took for the page to be downloaded. The value is in milliseconds.

* * * * * * * * * * * * * * * * * *
ParameterValue TypeDefault ValueMax LengthSupported Hit Types
pdtintegerNone * None * timing
*
* Example value: 500
* Example usage: pdt=500 *
*
*/ public TimingHit pageDownloadTime(Integer value) { setInteger(PAGE_DOWNLOAD_TIME, value); return this; } public Integer pageDownloadTime() { return getInteger(PAGE_DOWNLOAD_TIME); } /** *
*

* Optional. *

*

Specifies the time it took for any redirects to happen. The value is in milliseconds.

* * * * * * * * * * * * * * * * * *
ParameterValue TypeDefault ValueMax LengthSupported Hit Types
rrtintegerNone * None * timing
*
* Example value: 500
* Example usage: rrt=500 *
*
*/ public TimingHit redirectResponseTime(Integer value) { setInteger(REDIRECT_RESPONSE_TIME, value); return this; } public Integer redirectResponseTime() { return getInteger(REDIRECT_RESPONSE_TIME); } /** *
*

* Optional. *

*

Specifies the time it took for a TCP connection to be made. The value is in milliseconds.

* * * * * * * * * * * * * * * * * *
ParameterValue TypeDefault ValueMax LengthSupported Hit Types
tcpintegerNone * None * timing
*
* Example value: 500
* Example usage: tcp=500 *
*
*/ public TimingHit tcpConnectTime(Integer value) { setInteger(TCP_CONNECT_TIME, value); return this; } public Integer tcpConnectTime() { return getInteger(TCP_CONNECT_TIME); } /** *
*

* Optional. *

*

Specifies the time it took for the server to respond after the connect time. The value is in milliseconds.

* * * * * * * * * * * * * * * * * *
ParameterValue TypeDefault ValueMax LengthSupported Hit Types
srtintegerNone * None * timing
*
* Example value: 500
* Example usage: srt=500 *
*
*/ public TimingHit serverResponseTime(Integer value) { setInteger(SERVER_RESPONSE_TIME, value); return this; } public Integer serverResponseTime() { return getInteger(SERVER_RESPONSE_TIME); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy