1.0.8 • Published 3 years ago

trackers-consent-cookie v1.0.8

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Trackers Consent

trackers-consent-cookie is a cookies banner to respect new GDPR regulations.

Installation

Use the NPM or Yarn to install trackers-consent-cookie.

npm install trackers-consent-cookie

Usage in React

import TrackersConsent from 'trackers-consent-cookie';
<TrackersConsent
          language='en'
          trackers={{
            personalization: () => {}, // or undefined
            analytical: () => {}, // or undefined
            marketing: () => {}, // or undefined
            socialMedia: () => {}, // or undefined
          }}
/>

Usage in HTML

Get dist/bundle.js by running bellow command.

npm run build

Put bundle.js into the html file.

<script src="./bundle.js" type="text/javascript"></script>
<script>
    trackerConsent({
      language: "en",
      trackers: {
        personalization: () => {}, // or undefined
        analytical: () => {}, // or undefined
        marketing: () => {}, // or undefined
        socialMedia: () => {}, // or undefined
      }
    })
</script>

If the user accepts it once, then it doesn't have to appear anymore.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.

License

MIT