WeePie Cookie Allow & GTM consent mode v2

Published: 11-10-2024updated: 11-10-2024

WeePie Cookie Allow + Google Tag Manager

In this instruction we will do our best to explain you a basic example of how to implement Google Tag Manager (GTM) consent mode v2 with the WeePie Cookie Allow plugin. For this instruction we will add the Google Analytics (GA4) tag and test the Event Consent State (updated in the GTM dataLayer) before and after giving consent on our website.

WeePie Cookie Allow Plugin configuration

  1. Make sure you have version 3.4.8 (or higher) installed
  2. Go to the General plugin settings page section Google Tag Manager (GTM)
  3. Check the Enable field
  4. Check the Consent mode v2 field
Instruction WeePie Cookie Allow & GTM consent mode v2 - General settings

This will make sure the WeePie Cookie Allow plugin will push Google consent mode v2 data to the
GTM DataLayer
when users interact with the Plugin, e.g. accepting/declining cookies, saving the
cookie category settings
or when resetting their consent.

Google Tag Manager configuration

  1. Go to Triggers in the left menu
  2. Click on New

    Instruction WeePie Cookie Allow & GTM consent mode v2 – GTM dashboard create new trigger
  3. Give your new trigger any title you want
  4. Choose Custom Event under Trigger Configuration:

    Instruction WeePie Cookie Allow & GTM consent mode v2 – GTM dashboard trigger Custom Event
  5. In the Event name field enter: “wpca_consent_update
  6. Choose to fire the trigger when the Event contains wpca_consent_update:

    Instruction WeePie Cookie Allow & GTM consent mode v2 – GTM dashboard trigger configuration
  7. Now go to the Tags menu
  8. Click on New

    Instruction WeePie Cookie Allow & GTM consent mode v2 – GTM dashboard create new tag
  9. Under Tag configuration choose Google Tag
  10. Give your new Tag any title you want:

    Instruction WeePie Cookie Allow & GTM consent mode v2 – GTM Tag Configuration choose Google Tag
  11. Then fill in your Google Analytics Measurement ID in the Tag ID field:
    -> Read more on how to find your GA Measurement ID

    Instruction WeePie Cookie Allow & GTM consent mode v2 – GTM Tag Configuration set Tag ID
  12. Then go to Advanced Settings and make sure you have Once per event selected
  13. Next go to Consent settings > Additional Consent Checks and choose Require additional
    consent for tag to fire
    , then fill in: analytics_storage:

    Instruction WeePie Cookie Allow & GTM consent mode v2 – GTM Tag Configuration firing options and Consent Settings
  14. Go the Triggering and choose the Trigger you have just created: wpca_consent_update:

    Instruction WeePie Cookie Allow & GTM consent mode v2 – GTM Tag Configuration set Firing Triggers
  15. That’s it!

Test

You can now test if the GA4 tag (or your own tag) is blocked before consent and fired after consent.
Below we did a test on weepie-plugins.com. First without giving any consent:

Instruction WeePie Cookie Allow & GTM consent mode v2 – GTM Preview Mode - Tags blocked
Instruction WeePie Cookie Allow & GTM consent mode v2 – GTM Preview Mode - Event Consent State Denied

You can see that the GA4 tag is NOT fired and the Current State value for analytics_storage is Denied.

Now when we are going to give consent for Analytical cookies in our WordPress website, we can see that the GA4 tag is fired:

Instruction WeePie Cookie Allow & GTM consent mode v2 – GTM Preview Mode - Tags Fired

And last, we can see that the WeePie Cookie Allow plugin updated the dataLayer for
analytics_storage. The Current State for analytics_storage now haves the value Granted:

Instruction WeePie Cookie Allow & GTM consent mode v2 – GTM Preview Mode - Event Consent State Granted