Open michalpulpan opened 8 months ago
+1 to this, I was just about to ask the exact same question and saw someone beat me to the punch 🙏
As of right now I'm creating a hook around useGTMDispatch
:
const useConsentAwareGTM = () => {
const analyticsEnabled = useContext(AnalyticsContext)
const sendDataToGTM = useGTMDispatch()
return (data: any) => {
if (analyticsEnabled) {
sendDataToGTM(data)
}
}
}
But I'd prefer to not have to re-write all of our files to support this
Hello! Thank you for this amazing library. I'd like to ask you whether there's any recommended approach how to send
consent
events usingreact-gtm-hook
thank you in advance ✌️