Skip to content

Commit 721479b

Browse files
authored
Check for value before passing to gtag (#6415)
1 parent c5a2e15 commit 721479b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/Layout/Feedback.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,14 @@ const thumbsDownIcon = (
4545
);
4646

4747
function sendGAEvent(isPositive: boolean) {
48+
const value = isPositive ? 1 : 0;
4849
// Fragile. Don't change unless you've tested the network payload
4950
// and verified that the right events actually show up in GA.
5051
// @ts-ignore
5152
gtag('event', 'feedback', {
5253
event_category: 'button',
5354
event_label: window.location.pathname,
54-
value: isPositive ? 1 : 0,
55+
value,
5556
});
5657
}
5758

0 commit comments

Comments
 (0)