Search Unity

Question Disable automatic flush

Discussion in 'Unity Analytics' started by mylastggeast, Feb 13, 2023.

  1. mylastggeast

    mylastggeast

    Joined:
    Jun 14, 2021
    Posts:
    41
    Hello!
    Is it possible to disable the automatic flushing of events and only rely on the code calling Flush at precise times or to change the default flush time?

    I am working with some very specific platforms that require the presence of a verified code whenever we engage with a server, and we'd need a way to verify that the code is present before sending data to UGS.

    Thank you for your help!

    Davide
     
  2. RandolfKlemola

    RandolfKlemola

    Unity Technologies

    Joined:
    May 1, 2020
    Posts:
    130
    Hi Davide,

    Thanks for reaching out to the support team! Unfortunately, when using the Analytics SDK the 60-second upload and upload on shutdown are not configurable.

    Would it be a feasible solution that you only Initialize Unity Services after you receive this code you're speaking of?

    Another solution might be to send events strictly using the Analytics REST API, as there would be no upload interval with you in control of when to send events.

    Which platforms are you working with, may I ask? I believe this could be very interesting feedback for our Analytics team.

    Best,
    Randy
     
  3. RandolfKlemola

    RandolfKlemola

    Unity Technologies

    Joined:
    May 1, 2020
    Posts:
    130
    It should be mentioned (in case you're unaware) that there are a few events that are sent automatically when Initializing Unity Services, so it's likely you'd need the code you're referring to anyways before initializing.

    Randy
     
  4. mylastggeast

    mylastggeast

    Joined:
    Jun 14, 2021
    Posts:
    41
    Hello @RandolfKlemola and thanks for the update!
    Unfortunately, I cannot disclose the name or details on the platform since it's under NDA, but I can tell you it's a common console (no PC or mobile basically) use case.

    The workflow we are implementing first obtains the code and then initializes the UGS Analytics by calling
    Code (CSharp):
    1. await UnityServices.InitializeAsync(options);
    1. Can you confirm that no outbound calls are made before the above line and if the above line fails? If the UGS package sends events autonomously before it's initialized it could be a violation of guidelines.

    2. If we make a call to
    Code (CSharp):
    1. AnalyticsService.Instance.CustomData(eventName, parameters);
    before UGS has been initialized, would the event be sent after the initialization or it would just be ignored?

    The only problem with the above scenario is that the code has an expiration time and we would need to periodically regenerate it, that's why having control over flush would allow us to ensure no flush is made if the code is invalid / expired.

    That being said, I think it's acceptable for us to work with the above. It would be nice to add control over the flush rate in the future!

    Thank you for your help.
     
  5. RandolfKlemola

    RandolfKlemola

    Unity Technologies

    Joined:
    May 1, 2020
    Posts:
    130
    Hi again Davide,

    Understood, so NOT PC/Mobile, thanks!

    I'll paste my answers to your questions below with the same numbers.
    1. The UGS Analytics package does not upload any events prior to initializing the Unity Services. If you use Debug Event Reporting you can track event recordings as well as event uploads in the editor console, just to be sure.
    2. The Custom Event would be recorded but not uploaded. The event would be uploaded only after the initialization of Unity Services.
    I have created a feedback ticket with our engineers about controlling the Flush. It is not the 1st time it has been requested, we appreciate that feedback and are looking into it.

    Thanks!
    Randy
     
  6. mylastggeast

    mylastggeast

    Joined:
    Jun 14, 2021
    Posts:
    41
    @RandolfKlemola
    Thanks for the detailed answers! This pretty much covers everything I needed.

    Looking forward to the next UGS iterations.
     
    RandolfKlemola likes this.