Nat TaylorBlog, AI, Product Management & Tinkering

Minimal Analytics for GA4

Published on .

The standard Google Analytics implementation has always bugged me because requires 2 network calls to load the scripts then the time executing large scripts (98kb then 21kb gzipped, plus some time to execute.) Recently I discovered a very minimal implementation which is only about 670-bytes after uglification and gzip, which can implemented without a separate network call (except for the actual events). This is probably imperceptible on a fast connection, but a difference of around 700ms mobile.

Post Navigation

«