chore: start tracking approvals in ReactGA (#2311)

* chore: start tracking approvals in ReactGA

* move reactga to swap-only code
This commit is contained in:
Justin Domingue 2021-09-08 10:22:44 -04:00 committed by GitHub
parent 2bb695d84c
commit 115c72db9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -215,8 +215,14 @@ export default function Swap({ history }: RouteComponentProps) {
}
} else {
await approveCallback()
ReactGA.event({
category: 'Swap',
action: 'Approve',
label: [trade?.inputAmount.currency.symbol, toggledVersion].join('/'),
})
}
}, [approveCallback, gatherPermitSignature, signatureState])
}, [approveCallback, gatherPermitSignature, signatureState, toggledVersion, trade?.inputAmount.currency.symbol])
// check if user has gone through approval process, used to show two step buttons, reset on token change
const [approvalSubmitted, setApprovalSubmitted] = useState<boolean>(false)