Things like session duration and bounce rate, broken down by page, can tell what content people enjoy and what contents needs some work.All those things can be gathered from the initial request if you can set a cookie on the user's machine using a cookie header. If you're Firebase then you'd need a request for firebase-analytics.js to set the cookie, but the file itself could be empty.
Also useful to know what fraction of your users are recurring versus new users to tell whether people actually return to your site or if they just check it out once.
Once the cookie is set you can get all this from the server side logs.
Lastly, the refer stats can help you figure out what other sites and communities are interested in your project so that you can further engage with them.
Referers, if they're available at all, come in an HTTP header so once again server side logs would give you this data.
There is no reason to serve any JS for logging unless you want browser fingerprinting data like the user's window size. If your analytics script is more than 0kb then you're tracking people.