Repository navigation
Plain Consent 2.2.0 is a backward compatible minor release: the opt-in credit link is now written in the banner's language. A free, dependency-free cookie consent banner with true opt-in, Google Consent Mode v2, Subresource Integrity and a strict-CSP friendly runtime. MIT licensed, built on vanilla-cookieconsent 3.1.0.
The files are meant to be self-hosted: download them, put them on your own server and embed them. The banner makes no network requests and, with the defaults below, carries no third-party attribution.
What is new
- Localized, opt-in credit. The optional
"credit": truefooter link now follows the banner language (Czech and Slovak "Lištu poskytuje Socionet", English "Consent bar by Socionet", German "Consent-Leiste von Socionet", Polish "Pasek zgody od Socionet") and links to https://socionet.cz/ withrel="nofollow noopener". The text is fixed. It is off by default and the snippet below does not enable it.
Nothing else changed in behaviour. Full reference: README.
Install
- Download
plain-consent.jsandplain-consent.css(or the zip) from the assets below and place them on your web server, for example at/plain-consent/v2.2.0/. Do not minify or modify them, or the integrity check will fail. - Add this to the
<head>of your page, before all other scripts (especially before the Google tag):
<link rel="stylesheet" href="/plain-consent/v2.2.0/plain-consent.css" integrity="sha384-UigpuEPI8sZ22V7UM8A95UEmcs6VT3cmYC49ue/wrNcQw0Vm9Hf6SsjkLv0C7zlM" crossorigin="anonymous">
<script type="application/json" id="plain-consent-config">
{
"accent": "#1f2937",
"categories": ["analytics", "marketing"],
"privacyUrl": "/privacy/",
"consentMode": true,
"language": "auto",
"revision": 0
}
</script>
<script src="/plain-consent/v2.2.0/plain-consent.js" integrity="sha384-49/hm1U4h5BoIV9XtX4ORW+YCses85oU2wvNtqvepXLNiRpD8p2VBcdJRwRDA9Fi" crossorigin="anonymous"></script>- Tag scripts that need consent with
type="text/plain"anddata-category="analytics"(ormarketing,preferences), and embeds withdata-categoryanddata-src. - Add a withdrawal link to your footer:
<button type="button" data-cc="show-preferencesModal">Cookie settings</button>.
Upgrading from 2.1.0: replace the two file URLs and the two integrity values.
Subresource Integrity (sha384)
| File | integrity |
|---|---|
plain-consent.js |
sha384-49/hm1U4h5BoIV9XtX4ORW+YCses85oU2wvNtqvepXLNiRpD8p2VBcdJRwRDA9Fi |
plain-consent.css |
sha384-UigpuEPI8sZ22V7UM8A95UEmcs6VT3cmYC49ue/wrNcQw0Vm9Hf6SsjkLv0C7zlM |
LICENSE.txt |
sha384-Q3/LgG0LyClttbQ0PoWGaU+BLAdSPjC0CnLXhIN3NYgQoixCA2pkDMyVbJq5J0MK |
Check a downloaded file yourself: openssl dgst -sha384 -binary plain-consent.js | openssl base64 -A
Assets
plain-consent.js,plain-consent.css,LICENSE.txt: the release files, byte for byte what is inreleases/v2.2.0/at this tag.plain-consent-v2.2.0.zip: the same three files in one archive.
Published releases are immutable: this release never changes, and v2.1.0, v2.0.0 and v1.0.0 are untouched.