How can I trigger Google Analytics code to track pageviews using Cloudflare workers?

How can I trigger Google Analytics code to track pageviews using Cloudflare workers?

I’m curious why you would want to take this approach to tracking. Google Analytics—as with all user analytics—is placed such that when a user loads the resource it is triggered. Putting it in a worker would likely mean false analytics as it could potentially trigger for non-users and other non-page loading events.