Lurker News

Comments (337) 70 threads

Show all comments

Showing thread 3 of 70

js4ever4 replies#
Each time you hover over a link it's doing a GET request bypassing the cache (cache-control: max-age), even if you hove the same multiple times. Also this will make all your analytics false... Except that indeed this can improve greatly the user sensation of speed
mariopt3 replies#
The analytics should only be triggered is the page is rendered, assuming it's done client side. I believe Google does this for first top 3 results if I'm not mistaken.
michaelbuckbee#
This helped me quite a bit, my mental model of how this worked was off. Prefetching only downloads the resources but does not actually execute any js code. So sites doing lots of tag managers or other js loading js likely wouldn't benefit, but standard GA, etc. should be fine.
hombre_fatal2 replies#
Good point.

What would be a good way to avoid prefetch requests in your analytics if you only derive analytics from server access logs?

8bitben1 reply#
Most browsers pass a "purpose:prefetch" or similar HTTP header in the prefetch request that you can use to differentiate

Continue this thread — 1 reply

Drakim2 replies#
You could obviously do it with JavaScript by pinging the server to tell him that log entry X is to be promoted to a true "hit".

For a non-JS solution, I guess an tiny iframe at the bottom of the html page that accesses a special server page with an unique stamp that causes the same "hit". the iframe loading would mean that the rest of the page is mostly loaded before it was closed.

Continue this thread — 2 replies

dspillett1 reply#
Added bonus: these extra pre-loads on hover will tell you if someone nearly clicked a link. Your web server logs contain some poor-man's eye tracking. Could aid determining if important parts of your pages (warning messages and so forth) gather enough attention.
sleavey2 replies#
Seems like an invasion of privacy. I'd be surprised if someone hadn't used this sort of script for this already. Perhaps browsers or ad blockers will block this feature in the future.

Continue this thread — 2 replies

mygo#
If a GET request is all it takes for your analytics to be messed up, then your analytics are not reliable in this era of bots pinging everything.

You need to be emitting your analytics events from a rendered/executed page. Preferably with javascript, and a fallback resource link to a tracking url can work here.

chatmasta1 reply#
Might be worth adding something like a Pre-Fetch: True header to pre-fetched requests. But then the problem is, if the user pre-fetches and then actually views it, how does your analytics know unless the client then sends another request?
drewmol#
So would setting erroneous pre fetch headers to all requests would help to spoil analytics insights?
byron_fast3 replies#
What's more important - analytics, or the user experience. Damaging stats sucks, but this seems to outweigh that.
dentemple#
Clearly you're not in middle management.
aiisjustanif#
Without analytics, I don't justify my project soooo
williamdclt#
In a lot of legit cases, analytics. Especially versus a UX improvement that is clearly minor. The word "analytics" has bad rep but it's massively important to know if you're building the right product for your users, without a sort of analytics you're shooting in the dark