We use Debugbear to collect RUM data. And we found that one of tawk.to scripts affects INP score.
Here is a link to this script:
https://embed.tawk.to/_s/v4/app/69e0c09cf0a/js/twk-chunk-common.js
The problem is in this code:
this.initialDocumentClick = function () {
(t.$TawkAudioPlayer.init(), window.removeEventListener("click", t.initialDocumentClick));
}
This code calls t.$TawkAudioPlayer.init() on first “click” event and then removes it from event listener. This init() function could take more than 200ms and it causes INP issue (INP should be less than 200ms).
As a solution for such INP issues, web.dev recommends to use timeout function:
So, this small fix could solve INP issue:
this.initialDocumentClick = function () {
(setTimeout(function () {
t.$TawkAudioPlayer.init()
}, 0), window.removeEventListener("click", t.initialDocumentClick));
}
Hi @m1sha87 ,
Thank you for bringing this to our attention. We appreciate you taking the time to inform us.
I have shared the details with our development team for further review. I’ll keep you updated and get back to you as soon as we have more information.
Please don’t hesitate to reach out if you have any additional details to share in the meantime.
Screenshot from Debugbear:
Hi @JethroPaul ,
Any updates from development team?
As we still have problems with INP score and we are about to switch to other livechat.
Thank you for reaching out again.
I sincerely apologize for the delay. I will follow up with our Development Team and request an update regarding this matter. As soon as we receive any new information, we will get back to you promptly.
We appreciate your patience and understanding, and we understand the importance of resolving this issue given the impact it is having on your INP score.
Thank you for your continued patience, and we will keep you informed of any developments.