In the large majority of websites, Google Analytics fires even before the cookie banner, and the banner is only used to inform you that by continuing navigation you are accepting to be tracked.
Yes, this is illegal. But not enforceable.
[1]: there are devs selling websites for 500 dollars/euros.