While using Google Tag Manager, there can be Tags with multiple triggers. This article explains how we can block cookies with multiple Triggers.

In GTM, a tag will fire if all the triggers conditions on a tag evaluate to true. So you must add a condition to the existing trigger by adding a user-defined variable. Trigger conditions must all evaluate to true for the trigger to fire.

Here is an example of adding a consent condition to an existing trigger:

  1. Create a user-defined variable and name it "sp_user_consent". In the field "Custom Javascript", enter the following snippet:

    return window.dataLayer.map(function(m){ return m.event;}).join(','); 

2. Modify your custom event trigger configuration as shown below. The values of the cookie consent trigger condition to add are: Event - contains - {{Plugin name}}

Note: If your existing trigger is of the event type "Page View", you need to change it to event type "Window Loaded" since the visitor's consent is not available to GTM before the window has loaded.