Skip to content

Instantly share code, notes, and snippets.

@webtoffee-git
Created February 13, 2020 05:44
Show Gist options
  • Select an option

  • Save webtoffee-git/e71e99c8c573d8e0b15dd25d392e30a2 to your computer and use it in GitHub Desktop.

Select an option

Save webtoffee-git/e71e99c8c573d8e0b15dd25d392e30a2 to your computer and use it in GitHub Desktop.
CookieYes render custom script based on consent - www.cookieyes.com
<script>
function getCookie(name) {
var re = new RegExp(name + "=([^;]+)");
var value = re.exec(document.cookie);
return (value != null) ? unescape(value[1]) : 'no';
}
if (getCookie('cky-consent') == 'yes' && getCookie('cookieyes-analytics') == 'yes') {
// Enable my Analytics tracking as the analytics category consent and overall consent is granted
// Add anlytics script here
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment