TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Instead of tracking page loads, track how many times it was viewed (2017)

30 pointsby okfineover 7 years ago

2 comments

tahwover 7 years ago
&quot;Imagine you install analytics on a traditional content site. A few months later you update that site to be a single page application (SPA) without changing your analytics code. Then, a few months after that, you update your site to be a progressive web app (PWA) &quot;<p>Who on earth would ever do this? The worst boss of all time?
评论 #16424805 未加载
评论 #16428747 未加载
bluesmoonover 7 years ago
You&#x27;ll also want to track the pageshow and pagehide events (because of PageCache), and note that prerender is now obsolete. Browsers no longer support it and the spec is dead.<p>boomerang has been using PageVisibility for as long as the API has existed, and also handles the prerender case for when browsers did support it. The source is open if you&#x27;d like to see how we do it: <a href="https:&#x2F;&#x2F;github.com&#x2F;soasta&#x2F;boomerang" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;soasta&#x2F;boomerang</a>