Possible bug with Element Presence trigger?

Hi! I used Element Presence trigger many times successfully and it worked flawlessly, and I wanted to just now, but I encountered issues:

1st scenario:
I have an element (Form confirmation of WPCF7) that’s display:none at the page load, and when it loses display:none it IS detected by the trigger but after a long time like 5-10 seconds? I feel it used to work just instantly. Another thing is that I was using a JS variable as a condition for the trigger, and from what I’ve seen its value was also refreshed with delay, but not the same delay. Am I running into some edge case here? Even without JS variable as a condition (I removed it to test) it was the same behaviour.


2nd scenario, simpler:
I just have a trigger for presence of YouTube video, have lots of data recorded with it, and now I was just looking at one page I have video on, and it turns out it doesn’t trigger even after long time, css by querySelectorAll("iframe[src*='https://www.youtube.com/embed']") I use for this is returning the node element properly

Is there maybe some bug with Element Presence or am I using it wrong? :slight_smile:

Hi! Can you send me a link where I can see this behaviour live? Here or via DM

Thanks! I provided details over DM

Regarding the form - I suspect the issue is with the fact the element presence does not work based on element’s visibility (toggling display css property), but based on element’s presence in the DOM; with other words - if the element is present in the DOM it fulfills the requirements for the trigger. Is there a specific reason why you’re using this trigger instead of the form submission? As far as I know, WPCF7 should work fine with it.

As for the youtube tag - I couldn’t find anything unique about this one video, but again, is there a reason why it has the element presence trigger? Could you try with “all page views” and test this video again?

2 Likes

Alright, so I suspected this may be the case with element presence, although it seemed to work fine when used with this variable as condition, but there was just delay. I am not using form submission because I only want to track validated forms, and form submission event fires also for those that are not successful (get validation warnings). Also I didn’t want that to base on the phrasing of the message as it is in 2 languages and may change more likely than the coloring, at least this is how I figured it out at the time.

I will try changing the conditions for the youtube tag and will let you know whether it brings any results, thanks!