Array ( [0] => GDPR Cookie Consent [1] => CCPA [2] => Getting Started [3] => Changelog [4] => GDPR [5] => Add and Categorise Cookies [8] => Auto-block cookies with Script Blocker [13] => Create Privacy Policy Page [15] => Customize Cookie Notice [18] => Customize Settings Pop up [19] => Change Toggle button color [21] => Display Cookie List [22] => FAQ [23] => Getting Started [24] => Multilingual Support [25] => Overview [26] => Import Export Suite for WooCommerce [28] => Order / Coupon / Subscription Export Import Plugin for WooCommerce [29] => PayPal Express Checkout Payment Gateway for WooCommerce [30] => Changelog [31] => Getting Started [32] => Issue Refund [34] => Video Tutorial [35] => Print Invoice, Packing Slip, Delivery Note & Label for WooCommerce [36] => Address Label [39] => Changelog [41] => Credit Note [43] => Delivery Note [45] => Dispatch Label [47] => FAQ [48] => Invoice [49] => Adding meta data [50] => Customizations [51] => Email PDF Invoice [52] => FAQ [53] => Getting Started [54] => Invoice Number [55] => Multilingual Support [56] => Overview [57] => Packing Slip [58] => Customizations [59] => Getting Started [60] => Pick List [62] => Proforma Invoice [65] => Shipping Label [68] => Product Import Export Plugin for WooCommerce [69] => Smart Coupons for WooCommerce [70] => Abandoned Cart Discount [71] => Advanced Coupon Options [72] => Bulk Generate [73] => Changelog [76] => Getting Started [78] => Import Coupon [80] => Sales Countdown Timer [81] => SignUp Coupon [82] => Store Credit [84] => Volume/Quantity based coupon [85] => Stripe Payment Gateway for WooCommerce [86] => Alipay [87] => Apple Pay [88] => Changelog [89] => Compatibility with Subscription [90] => Getting Started [93] => SCA Ready [94] => Stripe Checkout [95] => Stripe Overview [96] => Stripe via Credit Card [97] => Troubleshoot [98] => Video Tutorial [99] => Subscriptions for WooCommerce [100] => Changelog [101] => Email Notifications [102] => FAQ [103] => Getting Started [104] => Manually Add or Modify Subscriptions [105] => Subscriptions Payment Gateway Guide [106] => URL Coupons for WooCommerce [107] => Changelog [108] => FAQ [109] => Getting Started [110] => Import URL Coupons [111] => QR Code Coupon [112] => WordPress Users & WooCommerce Customers Import Export )

Documentation/GDPR Cookie Consent/How to attain GDPR compliance by using Google Tag Manager

How to attain GDPR compliance by using Google Tag Manager

You can easily make your use of Google Tag Manager GDPR compliant with our cookie consent plugin. The GDPR Cookie consent plugin helps you to make your use of cookies and online tracking compliant with the EU-legislation on personal data and online privacy.

The pre-requisites for using Google tag manager are:

  1. An account in Google Tag Manager (GTM),
  2. Created a website container in GTM

Note:
The Google Tag Manager must be disabled from the dashboard prior to inserting the script into the theme or else the script blocker as a whole can also be disabled.

Script Blocking-GTM Disabled

Script Blocking-GTM Disabled

Following will detail the steps involved in attaining GDPR Compliance using GTM:

  1. Create a Trigger in GTM
  2. Insert GTM compatibility code snippet in the active theme

Create Triggers

The Triggers can be configured in the following manner:

  • From the GTM “Triggers” list, click “New”.
  • Choose “Custom Event” and enter an event name for the trigger, for example for category analytics you can enter the event name as “cli_cookieconsent_analytics”, in the field “Event name”.
  • Click “Save” to create the trigger and assign a name for the trigger, say Analytics.
  • This is how the trigger configuration pane will look like:

    GDPR GTM Compatibility-Trigger Configuration

    GDPR GTM Compatibility-Trigger Configuration

  • Repeat the above for each cookie category, for example, for non-necessary the event name can be given as “cli_cookieconsent_non_necessary”, and for marketing, it can be given as “cli_cookieconsent_marketing” and so on.
  • Now open the Tag configuration window and link the trigger you have just created from the triggering section. If any trigger was previously linked, it has to be removed prior to linking the newly created trigger. For instance, link the trigger Analytics with Google Analytics: Universal Analytics tag.
  • Click “Save” to create or update the tag.
  • This is what your final tag configuration pane will look like (except for the Tracking ID):

    GDPR Consent GTM Compatibility-Tag Configuration

    GDPR Consent GTM Compatibility-Tag Configuration

  • Finally, click “Publish” to push your changes live to your site.

The category associated in this manner will only set cookies if the visitor has accepted consent.

Insert GTM compatibility code snippet in the active theme

Next step would be to insert the code snippet into the active theme header file (header.php). The syntax of the code snippet for attaining GTM compatibility is as shown below:

function CookieLawInfo_Accept_Callback()
{
if (CLI.consent.cookie_category_slug)
{
dataLayer.push({'event': 'EventName'});
}
}



In the above syntax, replace cookie_category_slug with the actual category slug name and replace EventName with the actual event name given while creating a trigger.

ie:  For category analytics, you can insert the snippet in the following manner:

function CookieLawInfo_Accept_Callback()
{
if (CLI.consent.analytics)
{
dataLayer.push({'event': 'cli_cookieconsent_analytics'});
}
}

where the category slug is analytics and the event name is cli_cookieconsent_analytics

Note: If the category slug is a hyphenated word, then it must be replaced by an underscore. That is, for category non-necessary, the category slug can be entered as non_necessary.

For example, sample code snippet with three categories (as specified above) will look like:

function CookieLawInfo_Accept_Callback()
{
if (CLI.consent.analytics)
{
dataLayer.push({'event': 'cli_cookieconsent_analytics'});
}
if (CLI.consent.non_necessary)
{
dataLayer.push({'event': 'cli_cookieconsent_non_necessary'});
}
if (CLI.consent.marketing)
{
dataLayer.push({'event': 'cli_cookieconsent_marketing'});
}
}

  • Was this article helpful ?
  • YesNo