Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INP attribution eventTarget is empty #352

Closed
VishalGulati opened this issue Jun 7, 2023 · 2 comments
Closed

INP attribution eventTarget is empty #352

VishalGulati opened this issue Jun 7, 2023 · 2 comments

Comments

@VishalGulati
Copy link

I recently started exploring onINP and on integration in my React app code, I found it only randomly reports the eventTarget. Most of the times I got eventTarget as "". What could be the reason. Does INP need some attribute/HTML semantics to be in some particular way to work? Below is my code:

import {onINP} from 'web-vitals/attribution';

const sendVitals = (metricData = {}) => {
  console.log('INP --- ', JSON.stringify(metricData))
};

onINP(sendVitals, { reportAllChanges: true });

Here is what I get generally:

{
  "name": "INP",
  "value": 336,
  "rating": "needs-improvement",
  "delta": 336,
  "entries": [...],
  "id": "v3-993993993999-00901993993",
  "navigationType": "reload",
  "attribution": {
    "eventTarget": "",
    "eventType": "click",
    "eventTime": 38352.89999999851,
    "eventEntry": {
      "name": "click",
      "entryType": "event",
      "startTime": 38352.89999999851,
      "duration": 336,
      "processingStart": 38370,
      "processingEnd": 38631.60000000149,
      "cancelable": true
    },
    "loadState": "complete"
  }
}

How do I get the eventTarget to further work on this field data?

@tunetheweb
Copy link
Member

This is being tracked here: https://bugs.chromium.org/p/chromium/issues/detail?id=1428899

Though #344 could be another reason.

@tunetheweb
Copy link
Member

Duplicate of #335

@tunetheweb tunetheweb marked this as a duplicate of #335 Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants