From 2ab6f0e71001a1230b1dfe0389f84fc4547aa567 Mon Sep 17 00:00:00 2001 From: ekremney Date: Thu, 18 Apr 2024 13:35:42 +0200 Subject: [PATCH] fix: targetselector null safety --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index ae8d3d8..e434e90 100644 --- a/src/index.js +++ b/src/index.js @@ -118,8 +118,8 @@ function addCWVTracking() { data.cwv[measurement.name] = measurement.value; if (measurement.name === 'LCP' && measurement.entries.length > 0) { const { element } = measurement.entries.pop(); - data.target = sampleRUM.targetselector(element); - data.source = sampleRUM.sourceselector(element) || element.outerHTML.slice(0, 30); + data.target = targetselector(element); + data.source = sourceselector(element) || element.outerHTML.slice(0, 30); } sampleRUM('cwv', data); };