Documentation: Calls Reference
_trackError
Easily track errors such as broken links (HTTP 404) or server errors (HTTP 500).
_gaq.push(['_trackError', {
method: 'event', // optional 'event'|'page'
category: 'error', // optional string
error: /(404|500)/, // optional regex
value: 0 // optional value
}]);
Parameters
- method 'event'|'page'
- By default, this behaviour will be tracked as an event. If set to 'page', the behaviour will be to tracked using a fake page view.
- category 'error'|string
- Events are tracked with a Category, Action, Label and optional Value. This is the label that will show under the Content/Event Tracking/Categories report. The Action will be the HTTP Status code and the Label will be the URL where the error happened. If not using events, Category, Action and Label will be the faked page hierarchy represented as /Category/Action/Label. This parameter default value is 'error'.
- error /(404|500)/|regex
- By default, all calls will use the _gaq tracker. You can use a different tracker by overwriting the value of this parameter.
- value 0|real
- You can assign a value for this event. This parameter default value is 0.