Search Unity

Multiple Sessions in Single Application Use

Discussion in 'Unity Analytics' started by David-J-Foster, Jun 3, 2015.

  1. David-J-Foster

    David-J-Foster

    Joined:
    Jan 13, 2014
    Posts:
    18
    Hi there. I work on a lot of applications used by the public (e.g., an interactive shopfront), meaning we have thousands of users on a given day in a single instance of an application. I'd like to know if I can tell Unity Analytics, in code, to stop the current session and start tracking a new one. It seems my only option is:
    Code (csharp):
    1. UnityAnalytics.StartSDK(projectId);
    But testing this, attempting to call this several times in one application use results in the analytics data not being sent at all. Can I create multiple concurrent sessions? Any assistance is appreciated.
     
  2. kentunity

    kentunity

    Unity Technologies

    Joined:
    Sep 16, 2014
    Posts:
    55
    Calling StartSDK again after it has been called should not stop the Analytics from sending events.
    Right now our SDK doesn't expose session management to developers.
    What you can do is use CustomEvent and create a new event when a new user uses your app, or you can even just send a CustomEvent after a user has finished using your app, passing in custom parameters you want to track.
     
  3. David-J-Foster

    David-J-Foster

    Joined:
    Jan 13, 2014
    Posts:
    18
    Ah, data not appearing must have been a red herring then. I say that because I originally did what you suggested, except I was using a custom event with a custom GUID representing a session ID. The issue I had was, with the Funnel Analyser, it's not ostensibly possible to unify events with common custom data (in this case, session ID) to see their behaviour funnel. Or am I missing something?

    EDIT: I have looked into this no-data issue, and it seems something is awry. Using the "Validate Your Integration" section, I can see the events coming in, but if I try to use the Data Explorer to query their incidence, I just receive a "No Data" warning. This has been happening for the past two or three days. I'm not ruling anything out, but I could see events before I refactored the code to call UnityAnalytics.StartSDK(projectId) multiple times in a single run. I can PM my project ID if that might be at all useful?
     
    Last edited: Jun 4, 2015
  4. elie-noune

    elie-noune

    Joined:
    Apr 27, 2015
    Posts:
    20
    Hi David,

    We'd love to help you. Can you please post a new support ticket so we can look at your project and reference this forum post?

    Thanks!