i am using react native 0.70 and i integrate mixpanel SDK.
now I am trying to connect data in setup guide. but still did not track any event or user . please help
here is steps I followed :
step1:
const mixpanel = new Mixpanel(MIXPANEL_TOKEN,trackAutomaticEvents);
step2:
const _on_mixpanel_Init = async () => {
try {
await mixpanel.init();
mixpanel.setLoggingEnabled(true);
mixpanel.track("App launched");
mixpanel.track('Button Click', { button_id: '123' })
mixpanel.flush()
} catch (error) {
console.log(":rocket: ~ _on_mixpanel_Init ~ error:", error);
}
}
step3:
useEffect(() => {
_on_mixpanel_Init()
}, []);