1.0.8 • Published 5 years ago
trackers-consent-cookie v1.0.8
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-cookieUsage 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 buildPut 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.