A super flexible GDPR consent solution that, if implemented correctly, will make your site GDPR compliant.
What can you tell me about GDPR? This blog post does an exceptional job at explaining it.
The current version, 1.0.0
, is the initial proof of concept and is subject to substantial change. As such we recommend that you watch the repository for releases:
To install this project you will need to include the following code before all other scripts get loaded. If you do not do this then your site will not be able to be fully GDPR compliant as we cannot prevent other scripts from executing.
<!-- GDPR Consent -->
<script>
// TODO: Implement config:
// https://github.com/b3none/gdprconsent#customisable-settings
window.gdprconsent = {};
</script>
<script src="https://cdn.jsdelivr.net/gh/b3none/gdprconsent@1.0.0/build/scripts/gdprconsent.min.js"></script>
<!-- Other scripts below this point -->
You should also include our default stylesheet using the following snippet:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/b3none/gdprconsent@1.0.0/build/styles/gdprconsent.min.css" />
If the use of CDNs really isn't your style then please download the latest release and replace the CDN urls with your own hosted version.
This project allows you to specify custom settings. To declare these settings you need to put a script tag above the library include containing the following:
<script>
window.gdprconsent = {
services: [
{
storage_key: '<ANY_KEY_YOU_WANT>',
title: '<TITLE_IN_SIDEBAR>',
disable: function() {
// Callback used to disable the functionality
},
enable: function() {
// Callback to enable the functionality
},
}
]
};
</script>
We're happy to accept contributions so long as you're open to constructive criticism! Nobody is perfect!
We use SemVer. For the versions available, see the tags on this repository.
- Alex Blackham - Developer and Maintainer - B3none
See also the list of contributors who participated in this project.
If you appreciate the project then please take the time to star our repository.
This project is licensed under the MIT License - see the project license file for details