I have previously discussed Internet Tracking: The good, the and the ugly and even some precautions I have taken in How to Get back your online privacy
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
In the Gridsome Plugin directory there is a wrapper available for the Klaro! Simple and user-friendly consent manager.
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.
- Book Review: Continuous Architecture in Practice - March 20, 2023
- Book Review: Escaping the Build Trap - March 2, 2023
- How to create Github profile page - February 26, 2023