Search Unity

Metrics sent immediately or queued

Discussion in 'Unity Analytics' started by michael_voltage, Mar 20, 2015.

  1. michael_voltage

    michael_voltage

    Joined:
    Feb 27, 2015
    Posts:
    30
    Are the metrics sent immediately at time of call or are they queued and sent in a batch? If the latter, what are the rules that govern when they're sent.
     
  2. angeloferro

    angeloferro

    Moderator

    Joined:
    Sep 12, 2014
    Posts:
    105
    Hey @michael_voltage,

    Events from the SDK are queued and then sent in batches to our servers. We send the queued events at specific times to minimize the SDK's effect on app performance:
    1. When the app is first loaded
    2. When the app is paused or goes into the background
    3. When a scene transition occurs
    4. When a transaction event occurs

    Hope this helps!
     
  3. michael_voltage

    michael_voltage

    Joined:
    Feb 27, 2015
    Posts:
    30
    Fantastic Thanks! ;)
     
  4. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,906
    Does exiting the game trigger an event?
     
  5. kentunity

    kentunity

    Unity Technologies

    Joined:
    Sep 16, 2014
    Posts:
    55
    We try to cache and send events during the OnApplicationQuit().
    We treat OnApplicationQuit the same way we treat OnApplicationPause.
     
  6. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,906
    Thank you :)
     
  7. anticyclope

    anticyclope

    Joined:
    Oct 15, 2014
    Posts:
    2
    What if there's no internet connection at the time the batch is intended to be sent? Will it retry to send all the batches once the connection will become available?
     
  8. anticyclope

    anticyclope

    Joined:
    Oct 15, 2014
    Posts:
    2
    Ok, I've checked FAQ section ))
     
  9. sschan

    sschan

    Moderator

    Joined:
    Oct 8, 2014
    Posts:
    87
    Hi @anticyclope - Glad that you found the answer in our FAQs. :)

    To reiterate - Our SDK caches events that are sent if the request fails for any reason(e.g. no internet connection) after it reaches the retry threshold. Once there's an internet connection, we resend the cached events.
     
  10. CarpetHead

    CarpetHead

    Joined:
    Nov 22, 2013
    Posts:
    20
    I'm trying to gather statistics about things players do in a given app session. I tried to set it up so that an event was sent inside the OnApplicationPause Method - allowing me to send 1 event per "session". However these events never seem to make it to the console on a mobile device. Is there any way to work around this? Currently I do my own caching and send the event on the next app start