segmentio / analytics-react-native

The hassle-free way to add analytics to your React-Native app.
https://segment.com/docs/sources/mobile/react-native/
MIT License
367 stars 191 forks source link

MixPanel Integration not working #644

Closed filippobarcellos closed 2 years ago

filippobarcellos commented 2 years ago

I can see the events coming through in segment dashboard but they are not being sent to mixpanel. This is what I received in segment dashboard.

Why the mixpanel integration is false? Do I need to configure something else?

curl https://api.segment.io/v1/screen \
  -d anonymousId=03C4685C-02A5-4CF2-AC87-E9F93C2055DA \
  -d integrations[Mixpanel]=false \
  -d messageId=E0F00126-0898-4D61-8737-3ED85B0DA34C \
  -d name=Fixtures \
  -d originalTimestamp=2022-08-17T18:07:05.631Z \
  -d receivedAt=2022-08-17T18:07:16.148Z \
  -d sentAt=2022-08-17T18:07:15.569Z \
  -d writeKey=*******

Steps to reproduce

This is my config

async function init() {
    try {
        await analytics.setup(appConfig.segmentKey, {
            using: [Mixpanel],
            debug: true,
            recordScreenViews: true,
            trackAppLifecycleEvents: true,
            android: {
                flushInterval: 40000,
                collectDeviceId: true,
            },
            ios: {
                trackAdvertising: true,
            },
        });
        console.log('Analytics is ready');
    } catch (err) {
        console.error('Something went wrong', err);
    }
}

Expected behavior

Events to be redirect to mixpanel

Actual behavior

Can't see in mixpanel dashboard

raquelmsmith commented 2 years ago

Did you wait a bit? Sometimes it takes a bit for mixpanel to process/display the events.

filippobarcellos commented 2 years ago

Did you wait a bit? Sometimes it takes a bit for mixpanel to process/display the events.

Yeah I did, more than one hour tbh.

alanjcharles commented 2 years ago

Hi @filippobarcellos sorry to hear you're running into issues with your Mixpanel integration. We haven't had any other reports of this integration not working and there is not enough information here to help, I'm afraid. To answer your question

"Why the mixpanel integration is false? Do I need to configure something else?"

The integration will show as false in the integrations object if you have successfully enabled it in Cloud Mode. That flag tells our servers that the event has been handed off to the Mixpanel SDK and it shouldn't be sent from the server (again). You can read more about that here.

I would also definitely recommend updating to the new version of this library as we currently have more resources available to support that at the moment. If you are still running into issues with this integration and upgrading isn't an option, I would recommend reaching out to friends@segment.com for in-depth troubleshooting help. I am going to close this out for now but please feel free to comment with more information and I'll take a closer look.