Consent button for Google Analytics?

I think this may sound ridiculous for those who live in the US, but in European Union, one shall ask consent before saving cookies and/or collecting personal information from the user:

You have clearly acknowledged this as you say in the publishing plugin settings in the Google Analytics part:

Please check with your local laws and regulations first.

Could it be possible to enhance Google Analytics support so that the website user will get a small popup (for instance, in the bottom or top of the screen):
“This site uses Google Analytics” (Ok) (Deny)

and if the user clicks deny, Google Analytics script is not run.