According to EU Article 5(3) of the E-Privacy Directive (a.k.a \'The Cookie Laws\'), web sites that target EU users have to gain opt-in consent from users before they set a
You can use something like Legal Monster - to block cookies if user didn't give consent for analytical cookies.
legal.js currently supports blocking (and enabling) of analytics and marketing cookies; more categories will be available in the future.
Here is more detailed guide on blocking cookies.