To consent is for a visitor to give permission to the website to collect their personal data. However, you can only ask for consent if the reason is based on a legitimate purpose, e.g. “statistics” or “marketing”, which you must inform visitors about.  

For instance, if you sell shoes, you have a legitimate purpose for collecting your customers shoe size, but you have no business collecting their height or clothing size. Even if they consent to you collecting their data, you would need a legitimate reason for collecting any data other than their shoe size.

For a consent to be valid under the GDPR, it should be freely given, specific, informed and unambiguous.