Skip to content

Commit 6855b99

Browse files
author
Marco Pereirinha
committed
Fix CLS target
1 parent 3eec97c commit 6855b99

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

js/src/send-to-analytics.js

+3-11
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,9 @@ export function sendToAnalytics( { name, value, delta, id, attribution, rating }
6060
metric_rating: rating,
6161
};
6262

63-
switch ( metricName ) {
64-
case 'LCP':
65-
if ( lastEntry ) {
66-
return getNodePath( lastEntry.element );
67-
}
68-
break;
69-
case 'FID':
70-
if ( firstEntry ) {
71-
const { name } = firstEntry;
72-
return `${ name }(${ getNodePath( firstEntry.target ) })`;
73-
}
63+
switch ( name ) {
64+
case 'CLS':
65+
eventParams.debug_target = attribution.largestShiftTarget;
7466
break;
7567
case 'INP':
7668
const { processingDuration, presentationDelay, interactionTarget, interactionType } = attribution;

0 commit comments

Comments
 (0)