javascriptreactjslighthousepagespeed-insightscore-web-vitals

Web vitals onINP reporting elements that do not have any click functionality or handlers attached


In order to improve INP of my application, I integrated web-vitals@3/dist/web-vitals.attribution.iife.js to get field data and work on actual interactions causing poor INP score. However in my data I see a lot of elements reported actually dont have click functionality/handlers attached. For instance there are many div/span/p elements reported in the report. What is the reason behind such a behaviour. This basically makes improvement exercise very ineffective and lengthy. I am collecting attribution.eventTarget for the elements on which interactions happen.

attribution.eventTarget

function sendToAnalytics({name, value, rating, attribution}) {
  // here I am creating req payload with element as attribution.eventTarget 
}

onINP(sendToAnalytics);

Solution

  • There's a few reasons why seemingly non-interactive targets can be marked as the INP target, the two most common of which are:

    I also note you're using v3 of the library and would strongly recommend upgrading to v4 (and v5 soon!) so ensure you have the latest improvements to the library.