The ePrivacy directive dictates that you need to have consent for cookies that are not strictly necessary to serve the website and its basic functionality. If you were counting pageview stats without persisting any data on the client and without using any identifiers for users, I'd say you don't have to ask for consent, even under GDPR.