Mixpanel Community Icon

Integrating AppsFlyer Events with MixPanel in Unity

¡
¡

Hey, I am trying to get install event from AppsFlyer to MixPanel. I see events from MixPanel but is not associated with MixPanel id. I am using Unity and calling this once user login

Mixpanel.Identify(userId);
AppsFlyer.setCustomerUserId(userId);
  • Avatar of Cafer B.
    Cafer B.
    ¡
    ¡

    Hello, I’m not exactly sure about the flow of your app. However, if you call this once the user logs in, it is normal not to see it in the install event. If the user doesn’t log in, you aren’t setting the custom user ID on the Appsflyer side anyway.

  • Avatar of Hochul S.
    Hochul S.
    ¡
    ¡

    Thank you for the reply! What I want to do is I want to associate install event from AppsFlyer to user's MixPanel events. Is this something I need to do manually? I thought this is done automatically from AppsFlyer to MixPanel..

  • Avatar of Cafer B.
    Cafer B.
    ¡
    ¡

    The user has a distinct ID in Mixpanel. As I understand, you need to retrieve the distinct ID from Mixpanel and set it as the customer user ID in Appsflyer. I have read this section in the integration documentation. Retrieve the Mixpanel distinct ID and set it as the customer user ID using the Appsflyer SDK function setCustomerUserId.

  • Avatar of Hochul S.
    Hochul S.
    ¡
    ¡

    Yes that's why I am doing this. This is setting same id(distinct ID to MixPanel) to MixPanel and AppsFlyer.

    Mixpanel.Identify(userId);
    AppsFlyer.setCustomerUserId(userId);
  • Avatar of Hochul S.
    Hochul S.
    ¡
    ¡

    but I don't see this id is assigned to install event from AppsFlyer

  • Avatar of Cafer B.
    Cafer B.
    ¡
    ¡

    I see what you mean. However, there is a problem with the flow here. First of all, as I understand it, you are calling these functions upon login. But what you need to do is first retrieve the distinct ID from Mixpanel and set it as the customer user ID. After that, you need to initialize Appsflyer. At least, that’s what I gathered from the documentation. I also followed this approach exactly in my project. https://support.appsflyer.com/hc/en-us/articles/207447103-Mixpanel-integration-with-AppsFlyer

  • Avatar of Hochul S.
    Hochul S.
    ¡
    ¡

    ah, okay it makes sense. Let me try manual SDK init after the login. Thank you!

  • Avatar of Cafer B.
    Cafer B.
    ¡
    ¡

    Glad I could help, if I did. If you have further questions, I'd be happy to assist. Feel free to write me whenever you'd like. Have a great day or night, depending on where you are 😄

  • Avatar of Hochul S.
    Hochul S.
    ¡
    ¡

    Thank you!