Check for value before passing to gtag (#6415)

This commit is contained in:
Kathryn Middleton
2023-11-07 09:36:55 -05:00
committed by GitHub
parent c5a2e15d58
commit 721479b346

View File

@@ -45,13 +45,14 @@ const thumbsDownIcon = (
);
function sendGAEvent(isPositive: boolean) {
const value = isPositive ? 1 : 0;
// Fragile. Don't change unless you've tested the network payload
// and verified that the right events actually show up in GA.
// @ts-ignore
gtag('event', 'feedback', {
event_category: 'button',
event_label: window.location.pathname,
value: isPositive ? 1 : 0,
value,
});
}