Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save webtoffee-git/6148b971424bb9e3bf5eebe4d948c6b3 to your computer and use it in GitHub Desktop.
GDPR Compliance for Google Tag Manager - WebToffee GDPR Cookie consent plugin
<script>
function CookieLawInfo_Accept_Callback()
{
if (CLI.consent.non_necessary)
{
dataLayer.push({'event': 'cli_cookieconsent_non_necessary'});
}
if (CLI.consent.analytics)
{
dataLayer.push({'event': 'cli_cookieconsent_analytics'});
}
if (CLI.consent.marketing)
{
dataLayer.push({'event': 'cli_event_marketing'});
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment