Skip to content

This is the cookie management repo for implementing GDPR compliant cookie management functions

License

Notifications You must be signed in to change notification settings

anandhuKm/cookie-mgmnt

 
 

Repository files navigation

Cookie Consent Manager

AboutContributingLicensing

About

Cookie Consent Manager is a lightweight JavaScript plugin for alerting users about the use of cookies on your website.

It is designed to help you quickly comply with IAB/GDPR transparency and consent framework. We made it fast, free, and relatively painless.

We welcome community contributions and actively review pull requests.

Screenshots

CookieConsentManager__Sidebar

CookieConsentManager__BottomBanner

Advantages

  • Free and Open Source
  • Easy to use
  • Flexible and customizable: Manage consent for all possible types of third-party apps and easily customize the tool according to your needs.
  • Small footprint

Configuration

You define (and create) your own configuration as a JavaScript Object, containing as many properties as you deem necessary.

To get started, apiKey can be obtained from iGrant.io enterprise dashboard. If the cookie consent manager is configured as below, then the basic configuration and cookie purposes will be displayed as configured from iGrant.io enterprise dashboard.

<!-- Latest Version -->
<script src="https://cdn.jsdelivr.net/gh/L3-iGrant/[email protected]/dist/cookieconsent.min.js" type="text/javascript"></script>
<script>
    var config = {
        "apiKey": "",
        "onConsent": function (cookieType) {},
        "onConsentRevoke": function (cookieType) {}
    };
    new CookieConsentManager(config);
</script>

If you don't have an API key, there is manual configuration mode where basic configuration and cookie purposes are passed through configuration object. Below is an example,

<!-- Latest Version -->
<script src="https://cdn.jsdelivr.net/gh/L3-iGrant/[email protected]/dist/cookieconsent.min.js" type="text/javascript"></script>
<script>
    var config = {
        "onConsent": function (cookieType) {},
        "onConsentRevoke": function (cookieType) {},
        "basic": {
            "BannerHeader": "YOUR DATA, YOUR CHOICE",
            "BannerDescription": "uses cookies to enhance your experience of our website. By clicking Allow, you are consenting to the use of cookies.",
            "SidebarMainText": "uses cookies to enhance your experience of our website. By allowing, you are consenting to the use of cookies.",
            "SidebarSubtitle": "Manage Cookie Preferences",
            "SidebarSubDescription": "You can set your consent preferences based on the purposes below.",
            "CookiePolicyURL": "privacy.html",
            "CompanyPolicyURL": "",
            "CompanyName": "XYZ India Limited"
        },
        "cookiePurposes": [
            {
                "Title": "Google Adsense",
                "CookieTypeName": "Marketing cookies",
                "Description": "For displaying advertisment using Google Adsense to gain revenue",
                "BrowserCookies": [
                    "_gat",
                    "_gid"
                ],
                "IsRequired": false
            },
            {
                "Title": "Stripe",
                "CookieTypeName": "Essential cookies",
                "Description": "For integrating stripe payment gateway",
                "BrowserCookies": [
                    "__stripe_mid"
                ],
                "IsRequired": true
            }
        ]
    };
    new CookieConsentManager(config);
</script>

Contributing

Feel free to improve the plugin and send us a pull request. If you found any problems, please create an Issue.

Licensing

Copyright (c) 2021 LCubed AB (iGrant.io), Sweden

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.

You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the LICENSE for the specific language governing permissions and limitations under the License.

About

This is the cookie management repo for implementing GDPR compliant cookie management functions

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 68.9%
  • CSS 15.8%
  • Less 15.3%