bb108a0e by Marwin Cañeta

#32613 - Add mixpanel tracking on upgrade modal and the recent model used

1 parent 439c4058
......@@ -251,6 +251,31 @@ function App() {
}
}
useEffect(() => {
const element = document.querySelector('#modal-container #modal-cta')
const handleMixpanel = () => {
if (window.mixpanel) {
window.mixpanel.track('chatbot-plus-upgrade-modal', {
'click-location': 'upgrade-modal',
'upgrade': currentModel
});
}
}
if (element) {
element.addEventListener('click', handleMixpanel)
}
return () => {
if (element) {
element.removeEventListener('click', handleMixpanel)
}
}
}, [currentModel])
const [startedInteraction, setStartedInteraction] = useState(false);
return (
<div className="App">
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!