mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 20:23:08 +00:00
Check for value before passing to gtag (#6415)
This commit is contained in:
committed by
GitHub
parent
c5a2e15d58
commit
721479b346
@@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user