You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There appears to be a separate event listener being added for each event trigger to the body. Where our site has 14 triggers there are 14 event listeners attached to the body of the page that look identical. Where its an “All Links Click” there is about 100 ms being added to each click which is affecting the INP (One of Googles new CWV metrics).
It should be noted that we are using different options for each to trigger the link but that most pages only have 1 - 2 of the total and that the effect is on all links.
The text was updated successfully, but these errors were encountered:
Hi @ChalkTom . Thank you for taking the time to create this issue. Just to make sure I understand the issue, it sounds like you're seeing some performance issues due to the MTM triggers associated with link clicks. Have you tried setting more specific conditions on your triggers and did that help at all? Do you have any specific recommendations?
Hi @snake14 , each of the triggers are fairly specific and they mock the ones we were using in Google Tag Manager. The differences that I saw were that the Matomo triggers put a separate Event Listener on the the body for each one as well as adding out of the box other types of clicks such as right clicks which also have an event listener per trigger.
The only comparison I have done is with GTM for both their effect on the INP (Interaction to Next Paint) and how they handle event listeners. This may or may not be the reason I am seeing a difference and as I am not intimate with your code base am only guessing but the removal of the code completely gains me around 100 ms (20ms for GTM).
My suggestion would be that if possible only one Event Listener be added and that it should be able to handle all possible triggers for the the "All Links" function.
Cheers
Thank you for the additional information @ChalkTom . That sounds like a potential enhancement worth investigation. I will mark this issue for our Product team to review and prioritise.
There appears to be a separate event listener being added for each event trigger to the body. Where our site has 14 triggers there are 14 event listeners attached to the body of the page that look identical. Where its an “All Links Click” there is about 100 ms being added to each click which is affecting the INP (One of Googles new CWV metrics).
It should be noted that we are using different options for each to trigger the link but that most pages only have 1 - 2 of the total and that the effect is on all links.
The text was updated successfully, but these errors were encountered: