Filter out 304 in NA Pageviews

Hi netlifiers ! Just checking out Netlify Analytics. We also happen to use GoogleChrome’s Quicklinks script to prefetch navigable links. That script results in several pages with 304 status code on every page, and Netlify Analytics, according to the docs, counts as a page view.

So, I wonder why 304s are counted in pageview metrics, and if there’s a way to filter them out to make pageviews in NA more reflective of site traffic. Counting them results in a huge discrepancy between unique viewers and page views.

Thanks!

Hi Bud,

304’s indicate that the content was requested, so we count it as a pageview. This is working as designed. I understand that your app may cause requests that aren’t requested by the visitor themself, but to our CDN, they are just a pageload, and the fact that it’s a 304 is no different in that regard than if it’s a 200. Many 304’s are user-initiated (repeat visitors to unchanged content); this article describes how we handle normal site service around that content:

So - filtering out 304’s would also filter out any legitimate repeat traffic.

Could you tell me a bit more about how you’d differentiate the two? We are still actively developing the analytics feature including some filtering capability, but I can’t see how that would help you get an accurate picture - just a differently-inaccurate picture (for your admittedly “interesting” application - may be a normal use pattern, but for purposes of “what we send” and “what we charge for” - all requests to our CDN are equal :))

I’m going to look at the pre-caching mechanism and see if we can do them as XHR requests instead. Not sure if that might be more problematic in other aspects, but worth a look. Thanks for the reply!

Let us know how it goes, Bud!