Documentation: Calls Reference
_trackLoadTime
Track the loading time of the page. An event will be triggered with the corresponding 'bucket' of time. The accuracy of this method is to be taken with a grain of salt, however, since the methodology is consistent the results provide some insight on your fast vs slow loading pages as perceived from the end user point of view. Bucket can be an array of time slots (in milliseconds) or an integer representing the number of seconds in each bucket (i.e. 10 for buckets 10 seconds apart).
Caveat
It is recommended to use this feature sparsely if you use method:event. If you use it on every page, the number of Google Analytics calls will be doubled.
_gaq.push(['_trackLoadTime', {
onBounce: true, // optional boolean
method: 'event', // optional 'event'|'page'
category: 'loadTime', // optional string
bucket: [100, 500, 1500, 2500, 5000], // optional integer|array of integers
time: (new Date()).getTime(), // optional dateTime
value: 0, // optional real
index: 1, // optional [1-5]
scope: _GA_SCOPE_PAGE // optional _GA_SCOPE_PAGE|_GA_SCOPE_SESSION|_GA_SCOPE_VISITOR
}]);
This call can be used only once per page
Parameters
- onBounce true|false
- By default, the tracking will affect the bounce rate. If this option is false, the loading time will not be tracked if happening on the first page view of a visit.
- method 'event'|'page'
- By default, page loading time is tracked as an event. If set to 'page', the behaviour will be to tracked using a fake page view.
- category 'loadTime'|string
- Page loading time is tracked with a Category, Action and optional Value. This is the label that will show under the Content/Event Tracking/Categories report. If not using events, Category and Action will be the faked page hierarchy represented as /Category/Action. The Action will be the corresponding bucket. This parameter default value is 'loadTime'.
- bucket [100,500,1500,2500,5000]|integer|array of integers
- Time slices, or buckets, to split the page loading time. If using the default array, a page loading in 344 milliseconds will be classified as 100-499. If passed as a number of seconds (integer), for example, 10 seconds, that same page would be classified as 0-9 (seconds).
- time (new Date()).getTime()|datetime
- Specify the starting timestamp used to calculate the page loading time. Typically, you should not overwrite this parameter..
- value 0|real
- You can assign a value for this event. This parameter default value is 0.
- index [1-5]
- The custom variable slot number. The default value for this parameter is 1. Refer to Custom Variables in Google Analytics Help.
- scope _GA_SCOPE_PAGE|_GA_SCOPE_SESSION|_GA_SCOPE_VISITOR
- The scope of this custom variable - page (3), sesion (2) or visitor (1). Since this event pertains specifically to a page, this parameter shouldn't be overwritten. Refer to Custom Variables in Google Analytics Help.