This page is an example of how to setup a site with Google Analytics without Cookies.
Open your Dev console and try to find any cookie created by this website. You won't!
Navigate to other pages and notice how page view events are sent to Google on your network tab.
Although this site is built with Next.js, the same setup can be applied to any language or framework.
To learn how it works, read this blog post https://goenning.net/2021/02/01/cookieless-google-analytics