cookie-consent-js
Advanced tools
Comparing version 1.3.12 to 1.4.0
{ | ||
"name": "cookie-consent-js", | ||
"version": "1.3.12", | ||
"version": "1.4.0", | ||
"description": "A simple dialog and framework to handle the German and EU law (may 2020) about cookies in a website", | ||
"browser": "./src/cookie-consent.js", | ||
"main": "src/cookie-consent.js", | ||
"scripts": { | ||
"test": "tput setaf 4;echo open ./test/index.html in your browser for testing." | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
@@ -26,7 +26,3 @@ "repository": { | ||
}, | ||
"homepage": "https://github.com/shaack/cookie-consent-js#readme", | ||
"devDependencies": { | ||
"chai": "^4.2.0", | ||
"mocha": "^8.1.3" | ||
} | ||
"homepage": "https://github.com/shaack/cookie-consent-js#readme" | ||
} |
# cookie-consent-js | ||
A simple dialog and framework to handle the German and EU law (as written by EuGH, 1.10.2019 – C-673/17) about cookies in a website | ||
A simple dialog and framework to handle the German and EU law (may 2020) about cookies in a website | ||
@@ -8,5 +8,2 @@ - [Demo pages in plain HTML or with Bootstrap 4](https://shaack.com/projekte/cookie-consent-js/index.html) | ||
> **Note** We made a new version with more detailed cookie settings, which works with Bootstrap 4. You find it | ||
> at https://github.com/shaack/bootstrap-cookie-consent-settings | ||
## Usage | ||
@@ -50,28 +47,9 @@ | ||
### 6. Enable or disable tracking depending on configuration | ||
Client side JavaScript: Surround your tracking code with | ||
```js | ||
if(cookieConsent.trackingAllowed()) { | ||
// Google Analytics code and/or other tracking code | ||
} | ||
``` | ||
Server side PHP: Surround your tracking code with | ||
```php | ||
if($_COOKIE['cookie-consent-tracking-allowed'] === 'true') { | ||
// do some tracking | ||
} | ||
``` | ||
All other languages: Just read, if the cookie `cookie-consent-tracking-allowed` is "true" | ||
...that's all! [Contact me](https://shaack.com), if you have questions. | ||
...done! [Contact me](https://shaack.com), if you have questions. | ||
## API | ||
This framework writes a cookie (it's default name is `cookie-consent-tracking-allowed`) | ||
with the value `"true"`, if the user has accepted tracking. You can read the value with the JavaScript | ||
API (`cookieConsent.trackingAllowed()`) or from any other language, server or client side, which can read cookies. | ||
with the value `true`, if the user has accepted tracking. You can read the value with the JavaScript | ||
API (`cookieConsent.trackingALlowed()`) or from any other language, which can read cookies. | ||
@@ -149,4 +127,3 @@ ### JavaScript API | ||
You can disable `autoShowModal`, for instance, in the privacy policy and legal notice pages to make _these_ pages (better) readable. | ||
You should disable `autoShowModal` in the privacy policy page to make _that_ page readable. | ||
```js | ||
@@ -162,4 +139,2 @@ var cookieConsent = new CookieConsent({linkPrivacyPolicy: "privacy-policy.html", autoShowModal: false}) | ||
cookie-consent-js is a project of [shaack.com](https://shaack.com). | ||
If you use anything from this project, do so under the [MIT-License](./LICENSE). | ||
Please read the [LICENSE](./LICENSE). |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
33004
0
14
310
1
136