# Trigger custom code tag on dataLayer event

**URL:** <https://community.piwik.pro/t/trigger-custom-code-tag-on-datalayer-event/2703>\
**Category:** Data collection and tags\
**Created:** [August 9, 2023, 5:54am UTC](https://community.piwik.pro/t/trigger-custom-code-tag-on-datalayer-event/2703 "2023-08-09T05:54:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Reggie](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/reggie/32/2139_2.png) [@Reggie](https://community.piwik.pro/u/Reggie)\
**Post date:** [August 9, 2023, 5:54am UTC](https://community.piwik.pro/t/trigger-custom-code-tag-on-datalayer-event/2703/1 "2023-08-09T05:54:11Z")

</div>

I have a custom code (async) tag that handles order confirmation. It has a data layer event trigger such that it triggers when event name contains ‘`order_confirmation`’. But it doesn’t trigger in the debugger. On the screenshot, I found the ‘order\_confirmation’ data layer event in events log (which means it was called), no tags were fired in ‘Related tags’, I clicked on the one I want to fire and check conditions (bottom of the screenshot) and it says the condition wasn’t met.

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/piwikpro/original/2X/2/2c7c7ba22ea301d82d040e318c0d81c303f427c9.png)

---

<div class="post-metadata">

**Author:** ![Oliwer\_Kaczmarek](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/oliwer_kaczmarek/32/3888_2.png) [@Oliwer\_Kaczmarek](https://community.piwik.pro/u/Oliwer_Kaczmarek)\
**Post date:** [August 9, 2023, 9:50am UTC](https://community.piwik.pro/t/trigger-custom-code-tag-on-datalayer-event/2703/2 "2023-08-09T09:50:58Z")

</div>

Hi @Reggie,

This can happen when you did not gave a particular consent that the tag you are using requires. For example:

- Tag have a consent type: Analytics.
- User visits the page and does not give Analytics consent.
- Event that should trigger the tag does not do that (shows X next to the trigger) becuase the consent was not given.

Let me know if that was the case here. If not please share with me (for example via private message) where can I check this setup

Best,  
Oliwer

---

<div class="post-metadata">

**Author:** ![Reggie](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/reggie/32/2139_2.png) [@Reggie](https://community.piwik.pro/u/Reggie)\
**Post date:** [August 10, 2023, 6:45am UTC](https://community.piwik.pro/t/trigger-custom-code-tag-on-datalayer-event/2703/3 "2023-08-10T06:45:40Z")

</div>

Hello, yes this was the problem. Thank you!
