I'd like to get information out of the Google Analytics API about the HTTP status codes returned by my application.

For example:

  • For a given date range, I'd like to know how many 404 responses were returned.
  • I'd like to filter only pages that were returned with a 200 code - excluding error pages.

Is this possible with v3 of the Analytics API? I've been reading through the reference manual but I can't find a full list of all the dimensions and metrics that are supported.

Note: I know I could find 404 pages by filtering on the page title (e.g. if it contains "404") but that seems much less satisfactory than looking at the HTTP code.

  • Sounds like you'd want a statistical package that reads your access and error logs (you can use more than one).
    – dan
    Commented Feb 17, 2014 at 17:11

1 Answer 1


Google Analytics is not good at tracking response codes. The JavaScript snippet does not usually get installed on 404, or 500 error pages. It would be possible to do so using custom error pages, but most webmasters don't do it.

JavaScript doesn't execute on some response types like redirects. There is no way to use Google Analytics to directly track when redirects happen. I usually end up using event tracking when a user clicks on a link, or append UTM parameters to the redirect so that Analytics can see it as a campaign after the redirect.

Because of these limitations, Google Analytics doesn't treat the HTTP response code as a dimension that you can filter on or create reports with.

Instead, you should analyze you servers log files for this information. Server log files do contain information about error responses.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.