Free, Intelligent and Serverless Page View/Read Count using Google Analytics and Cloudflare Workers

Using Google Analytics to generate a SVG image of the Page Reader/View Count through Cloudflare Workers

Engagement on websites and blogs is often measured through view counts. However, not all views represent meaningful engagement. External services like VisitorBadge.io can display view counts via an SVG image, but they lack the ability to delay view triggers while showing current counts. An alternative is using Google Analytics, which provides comprehensive website health metrics. For architectural simplicity and compatibility, especially with static websites, a Cloudflare worker can be used to fetch and display views from Google Analytics.
software-engineering
Author

Kabui, Charles

Published

23 November 2024

Keywords

page-views, page-reads, google-analytics, cloudflare-workers, github-pages, static-pages, azure-functionns, lambda-functions, google-cloud-functions, serverless-architecture