diff --git a/packages/sui-react-web-vitals/src/index.js b/packages/sui-react-web-vitals/src/index.js index 1baa1c103..a3b06d28f 100644 --- a/packages/sui-react-web-vitals/src/index.js +++ b/packages/sui-react-web-vitals/src/index.js @@ -100,10 +100,10 @@ export default function WebVitalsReporter({ const pathname = getPathname(route) const routeid = getRouteid() const isAllowed = allowed.includes(pathname) || allowed.includes(routeid) + const target = getTarget({name, attribution}) - if (!isAllowed || !logger?.cwv || rating === RATING.GOOD) return + if (!isAllowed || !logger?.cwv || rating === RATING.GOOD || !target) return - const target = getTarget({name, attribution}) const {loadState, eventType} = attribution logger.cwv({