Question

Data/Events from Unity SDK not appearing in mixpanel project

  • 4 August 2020
  • 2 replies
  • 207 views

Hi,

We are trying to integrate Mixpanel into our project and we are having difficulties setting it up.

 

From what I was able to gather that might be relevant to our issue:

  1. It’s been around 6 hours since sending our first test events.
  2. We have successfully setup our project via dashboard (“Check for incoming data” via “Install Mixpanel” page returns “We successfully received your data!” message.).
  3. We’ve quadruple checked our tokens (actually both production and debug tokens are now pointing to the same mixpanel project just to be sure).
  4. We are based in European Union and we’ve enabled European Union Data Residency.
  5. We are logging in via mixpanel.com not eu.mixpanel.com
  6. We are testing on Android (Unity debug build only) and in Unity editor.
  7. We are not getting any errors.
  8. We are getting “[Mixpanel] ENQUEUE_EVENTS” logs.
  9. We are getting “[Mixpanel] Dispatching new operations: FLUSH” logs.
  10. We are getting “[Mixpanel] Sending request - 'https://api.mixpanel.com/track/?ip=1' with payload” logs with payload that changes depending on the enqueued events.
  11. We are getting “[Mixpanel] Response - 'https://api.mixpanel.com/track/?ip=1' was '1'” logs (not sure what the response should be).

From here I would expect to either get errors or see some data in mixpanel dashboard (Live View or Data Audit).

 

I would like to ask if what we’ve done so far makes sense and is it just a matter of time before our events start showing up in the mixpanel project or are we missing something?

 

This is how we send events if it matters in any way:
  public void SendMixpanelEvent(string key, Value context = null) {
    if (context != null) {
      Mixpanel.Track(key, context);
    } else {
      Mixpanel.Track(key);
    }
  }

 

This is how we initialize Mixpanel on our side:

  public async Task InitializeAsync(string userId) {
    Mixpanel.Init();
    await r_awaitInit();
    Mixpanel.Identify(userId);
    initialized = true;
  }

  IEnumerator r_awaitInit() {
    yield return new WaitUntil(() => Mixpanel.IsInitialized());
  }

 

Hope someone can point us in the right direction.

Best regards,

Jan


2 replies

We’ve just solved it. For anyone else having this issue. It’s simple to fix.

  1. Read the documentation fully (especially the Getting started section).
  2. Set the API Host address in MixpanelSettings to: https://api-eu.mixpanel.com (only if you are actually using European Union Data Residency for your project).

With this set correctly, we are now getting info live both from Unity Editor and Android. Not sure about iOS yet, but according to documentation (https://developer.mixpanel.com/docs/implement-mixpanel under “Implementing Mixpanel in the European Union (EU)” → “iOS SDK”) this solution should be sufficient.

 

Sidenote:

It turned out we were actually using eu.mixpanel.com to log in (it changes when you switch to the project using European Union Data Residency even if you logged in via mixpanel.com).

Userlevel 6
Badge +3

@jansensevr Thank you so much for closing the loop here and sharing how you solved the issue! I’m sure it will help someone looking for an answer down the road. 

 

I’m happy to hear you were able to find a solution :slight_smile:  

Reply


Mixpanel