GDPR Cookie Law – JavaScript GDPR Cookie Consent Plugin example – Custom hyperlinks
For the best user experience on the demo site, the cookies are automatically deleted. This way you can always see the notification toolbar.
Custom hyperlinks
Example code
<link rel="stylesheet" href="http://your-domain.com/gdpr-cookie-law/css/gdpr-cookie-law.min.css">
<script src="http://your-domain.com/gdpr-cookie-law/js/gdpr-cookie-law.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
var gdprCookieLaw = new GDPRCookieLaw({
desc: 'We use {{myCustomAnchor1}} to ensure that we give you the best experience on our website. By continuing to use our site, you accept our {{myCustomAnchor2}}.',
moreLinkStatus: false,
customAnchors: [
{
id: 'myCustomAnchor1',
href: 'http://your-domain.com/cookies',
title: 'About cookies',
target: '_blank',
text: 'cookies'
},
{
id: 'myCustomAnchor2',
href: 'http://your-domain.com/privacy-policy',
title: 'Cookie policy',
target: '_blank',
text: 'cookie policy'
}
]
});
gdprCookieLaw.init();
});
</script>
Related options
Peoprty | Possible Values | Default Value | Description |
---|---|---|---|
desc | 'Any text what you want' | 'We use cookies to ensure that we give you the best experience on our website. By continuing to use our site, you accept our cookie policy.' | The description of the pop-up. |
moreLinkStatus | true, false | true | Enable or disable the appearance of the 'More information' link. If the value is true, the 'More information' link appears. If the value is false, the 'More information' link does not appear. |
customAnchors | e.g. [ { id: 'cookies', href: 'http://your-domain.com/cookies', title: 'About cookies', target: '_blank', text: 'cookies' }, { id: 'cookiePolicy', href: 'http://your-domain.com/privacy-policy', title: 'Cookie policy', target: '_blank', text: 'cookie policy' } ] | null | You can add custom anchors to the description. E.g. desc: 'We use {{cookies}} to ensure that we give you the best experience on our website. By continuing to use our site, you accept our {{cookiePolicy}}.' |