LCP tracking is not working

Hello all,

I have a Shopify embedded app made with ReactJS. I implemented web-vitals using app-bridge-react version 4.1.2, but it’s not working. Does anyone have any idea how I can get it to work? I’ve attached my code snippet below.

index.js

reportWebVitals((metric) => metric);

reportWebVitals.js

import { getCLS, getFID, getFCP, getLCP, getTTFB } from "web-vitals";

const reportWebVitals = (onPerfEntry) => {
  if (onPerfEntry && onPerfEntry instanceof Function) {
    getCLS(onPerfEntry);
    getFID(onPerfEntry);
    getFCP(onPerfEntry);
    getLCP(onPerfEntry);
    getTTFB(onPerfEntry);
  }
};

export default reportWebVitals;

Thank you in advance for your help!

Best regards,
Jaymit Beladiya

Hey, did you fix?