Click element matches css doesn't work

Hi,

I have the following HTML:

<div id="g-378890477" class="grp cms-component cms-button-element link-to-swatch element-custom-block-3348782867 x6 layoutGrp cms-block-type-button" style="width:auto;float:right;display:inline-block;padding-top:.5em;padding-bottom:.5em;padding-left:2em;padding-right:2em;border-radius:60px;font-size:1.25rem;line-height:1;color:rgba(254,80,0,1.00);background-color:rgba(255,255,255,1.00)"><a class="nav-jump" id="to3348782867" name="to3348782867"></a><div id="element-custom-block-3348782867" class="element ">
    <div class="grp p0 sf media button " id="sfid-3348782867" block-type="button">
        <a class="button-link custom-button title grp p0 pointer" rel="noopener noreferrer" style="color:inherit !important;" href="URL" target="_blank" role="link" tabindex="0">CONNECT NOW</a>
    
                <div class="button-body-wrap hide">
            <div class="button-body body grp p0">
                Text goes here            </div>
            <a href="#" class="close-fixed-modal">X</a>
        </div>
    </div>
</div></div>

— I created the following trigger event condition: Click element > matches CSS

#g-378890477, #g-378890477 *

But the tag won’t fire. What is weird to me is that the exact same trigger works in google tag manager. I’m wondering if Piwik PRO uses a different type of ccs selector??

Any other ideas on how to build a trigger around clicks on this element?

Thanks

Hi. Could you check the click event from the tag manager debugger? I mean this view:
image

This confirms that the event contains all the data we need to make it work.

Hi @kuba sure

elementId here is empty, but there is an id in the HTML. So, not sure why it says is empty.

Anyways, looks like I could make it work by tracking these 2 elements, correct?
elementClasses": “button-link custom-button title grp p0 pointer”,
“elementUrl”: “Meeting request

If you have some nested structures like many divs, the safest option is to use “is child of”. Then you have all cases covered.

Hi @kuba based on the screenshot and your feedback. Here is another attempt

click element > is child of > .button-link

Still not firing. Can you advise? thanks

I just recreated your setup and works for me:

I test it by clicking on the URL marked with CONNECT NOW. It you would like to track clicks for the entire div, you can pick other class such as .cms-button-element.

Thanks @kuba the tag wasn’t firing due to a cookie consent problem. Have a good day