Integrating Cloudflare Workers + Google Analytics Pageviews in Hugo Blog
Background As a Hugo static blog hosted on Cloudflare Pages, I’ve always wanted to display real pageview data on article pages. But the problem is: Google Analytics gtag.js can only “write” data, can’t “read” historical data Static blogs have no backend, can’t directly call GA4 Data API Don’t want to depend on third-party services (like Busuanzi), want complete control over data After research, I chose the Cloudflare Workers + Google Analytics Data API solution, which perfectly solved this problem. ...