Mobile app version of vmapp.org
Login or Join
Fox8124981

: Google Analytics API: return data on HTTP status codes? I'd like to get information out of the Google Analytics API about the HTTP status codes returned by my application. For example: For

@Fox8124981

Posted in: #Analytics #GoogleAnalytics

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.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Fox8124981

1 Comments

Sorted by latest first Latest Oldest Best

 

@BetL925

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme