Track child div click by tracking parent div

Hello,

Im running Matomo 4.12.3 on premise.

I have the scenario where divs are being generated with dynamic class names and/or sharing class names along multiple divs.

so I went with wrapping each one with a parent div that I can control the id and/or class for,
consider this:

<div id="parent-unique-id" class="parent-unique-class" >
   <div class="dynamically-generated-class">
.
.
.
   </div>

</div>

I want to track clicks on the child div (inner div), so I set the trigger in Matomo tag manager to match the class name for the parent div along with the tag thats attached to the mentioned trigger, but it’s not being triggered when clicking on the child div.

any help is appreciated!