Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question First time using analytics

Discussion in 'Unity Analytics' started by unitynoob24, Aug 1, 2023.

  1. unitynoob24

    unitynoob24

    Joined:
    Dec 27, 2014
    Posts:
    398
    Hey guys,

    First time using analytics. I'm using the latest 5.0.0 and got some custom events up and running.

    I didn't realize that unity is already tracking transactions - but I had implemented my own event for tracking in app purchases. My app currently has 5 in app purchases, I simulated buying one of each from my phone. Only 2 of them seem to have gone through; based on my event browser / data explorer. I am also seeing like 9 transaction events from unity that popped up, most of them are duplicates or triples of some of the IAPs that I was testing.

    Was just wondering if that was normal behavior. If not, that is kind of alarming that a single purchase is triggering several transaction events to the backend.

    I also noticed it seems like I'm not getting my events to fire from device a lot, and it seems to be tied to my events that happen to be calling around the same time in my code that I am doing cloud save / back up stuff. Is it possible to ensure my analytics custom data events always trigger? I attempted setting up a queue of actions and wrapping my calls in that so instead of calling them directly basically I enqueue them, then dequeue them in a while loop.

    Thanks in advance!

    EDIT: So I did the same test, I simulated purchasing one of each IAP in my game. And all five went through this time. The only difference was I had left the app running. Is it possible that Unity is already doing some kind of batching / pooling and mass calling on a tick or something? Maybe my first attempt the app was shut off before it could send the other three?
     
    Last edited: Aug 1, 2023
  2. unitynoob24

    unitynoob24

    Joined:
    Dec 27, 2014
    Posts:
    398
    BUMP - it seems like it always works from editor on my PC but on phone some events either never work at all and some events sometimes work. And by work I mean, appear in the dashboard. Thoughts?