cookie-consent-js
Advanced tools
Comparing version 1.1.10 to 1.2.0
{ | ||
"name": "cookie-consent-js", | ||
"version": "1.1.10", | ||
"version": "1.2.0", | ||
"description": "A simple dialog and framework to handle the German and EU law (may 2020) about cookies in a website", | ||
@@ -5,0 +5,0 @@ "main": "src/cookie-consent.js", |
@@ -36,8 +36,8 @@ # cookie-consent-js | ||
```js | ||
cookieConsent.isTrackingCookieAllowed() | ||
cookieConsent.trackingAllowed() | ||
``` | ||
Use this function to disable tracking. | ||
Suround tracking code, like the Google Analytics code with | ||
Returns `true` if the user did accept tracking cookies. | ||
Use this function to disable tracking. Suround tracking code, like the Google Analytics code with | ||
```js | ||
if(cookieConsent.isTrackingCookieAllowed()) { | ||
if(cookieConsent.trackingAllowed()) { | ||
// Google Analytics code and/or other tracking code | ||
@@ -51,3 +51,3 @@ } | ||
```php | ||
if($_COOKIE['cookie-consent-accept-all'] === 'true') { | ||
if($_COOKIE['cookie-consent-tracking-allowed'] === 'true') { | ||
// do some tracking | ||
@@ -88,3 +88,3 @@ } | ||
modalId: "cookieConsentModal", // this may not be changed | ||
cookieName: "cookie-consent-accept-all" // this may not be changed | ||
cookieName: "cookie-consent-tracking-allowed" // this may not be changed | ||
} | ||
@@ -91,0 +91,0 @@ ``` |
@@ -37,3 +37,3 @@ /** | ||
modalId: "cookieConsentModal", // this may not be changed | ||
cookieName: "cookie-consent-accept-all" // this may not be changed | ||
cookieName: "cookie-consent-tracking-allowed" // this may not be changed | ||
} | ||
@@ -142,3 +142,3 @@ for (var property in props) { | ||
this.isTrackingCookieAllowed = function () { | ||
this.trackingAllowed = function () { | ||
return getCookie(this.props.cookieName) === "true" | ||
@@ -145,0 +145,0 @@ } |
Sorry, the diff of this file is not supported yet
18590