What is a cookie consent
There are many different ways on how cookies of first and/or third party provenance can track website users. A good example is the IP address or merely the actions and choices of users not exclusively on the site, but also differ from site to site.
Many notable modern websites have hundreds of useful and active cookies and online tracking in use.
What is GDPR?
The General Data Protection Regulation, is a known ePrivacy regulation.
GDPR contains six data protection principles:
- Lawfulness, fairness, and transparency
- To purpose limitations
- Works in data minimization
- Provide accuracy
- Meet storage limitations
- Integrity and confidentiality
GDPR defines six lawful bases for processing personal data:
- Consent – the individual should be able to provide clear and straightforward consent for you to make use. In that way, you can process their personal data for a specific purpose.
- Contract – the processing is necessary for a contract that you have with the individual. Taking careful and specific steps before entering into a contract is important and necessary.
- Legal obligation – the processing, of course, is necessary and important for you to comply with the law.
- Vital interests – accurate processing is essential to protect someone’s life and privacy.
- Public task – the processing is necessary for you to perform a task in the public interest. It is also important for your official functions, and the task or function should have a clear basis in law.
- Legitimate interests – viable legitimate interests or the legitimate interests of a third party is another important reason for processing, excepting that there is a good reason to protect the individual’s personal data and privacy which will nullify those legitimate interests.
How to Implement Cookie Consent with Gridsome
Klaro is a free & open-source tool that provides an intuitive, user-friendly and compliant way to manage consent on your website. Klaro is easy to use and configure, lightweight and compatible with all modern browsers.
We are going to go ahead and implement this on Geek.I.Am and configure to inform the user we are using Google Analytics.
Install Klaro Gridsome plugin
We will just use the terminal to install the plugin into our project.
Once this is complete we will then need to edit our
gridsome.config.js to configure the plugin for use. We just need to add the following information to our plugins section
You will notice that we need to create an additional page in website, as we defined with
privacyPolicy: '/privacy', so we just need to add that page in
If we start up our website using
gridsome develop and browse to
http://localhost:8080 we will be able to see our new Cookie Consent pop up.
If the user clicks the customize.. they will be presented with a screen to switch Google Analytics on or off.
You can easily add other options to Klaro should your website be using more. Check out the Klaro sample configuration file for examples.
- How to use Github actions to build & deploy Github nuget packages - October 14, 2021
- How to implement cross cutting concerns with MediatR Pipeline Behaviours - October 5, 2021
- Understanding the difference between Queue and Stack Data Structure - September 22, 2021