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() { ...@@ -251,6 +251,31 @@ function App() {
251 } 251 }
252 252
253 } 253 }
254
255 useEffect(() => {
256 const element = document.querySelector('#modal-container #modal-cta')
257
258 const handleMixpanel = () => {
259 if (window.mixpanel) {
260 window.mixpanel.track('chatbot-plus-upgrade-modal', {
261 'click-location': 'upgrade-modal',
262 'upgrade': currentModel
263 });
264 }
265 }
266
267 if (element) {
268 element.addEventListener('click', handleMixpanel)
269 }
270
271 return () => {
272 if (element) {
273 element.removeEventListener('click', handleMixpanel)
274 }
275 }
276 }, [currentModel])
277
278
254 const [startedInteraction, setStartedInteraction] = useState(false); 279 const [startedInteraction, setStartedInteraction] = useState(false);
255 return ( 280 return (
256 <div className="App"> 281 <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!