jimbas
Forum Replies Created
-
Hi Mat:
Thank you for following up. I couldn’t attach a listener and went a different direction with google analytics/events. That didn’t work either lol.
I’ll get back to it at some point probably. I’ll mark as resolved so it’s not taking up space.
I appreciate your response and time. 🙂
Jim
thank you mat. i’m going to look into this as soon as i can and i’ll circle back. it might be a bit before i do but i really appreciate your answer and the time you took.
jim
Hi Mat,
Thanks for replying.
I’m looking specifically to send a matomo Event when someone clicks a YouTube subscribe button on my site. The problem is if I try to edit the html in order to add an onmouse* click event the Gutenberg editor says the element is corrupt.
I’ve also tried to add a document listener as well, I’ve had trouble doing this but possibly b/c of the YouTube button itself and how it may be late-created to the page.
But I didn’t know if there was some type of Gutenberg “approved” way of adding things like onmouse* events or onclick etc which wouldn’t cause the GB editor to think the element was corrupt, or if the recommendation is to use the DOM/jQuery selectors to add events dynamically.
Hopefully that makes sense. I can post some code if that would help more.
I ended up going down the avenue of using google analytics tagmanager to do something similar.
Jim