Exemplo n.º 1
0
 void Awake()
 {
     gav3.StartSession();
     if (!Social.localUser.authenticated &&
         Application.internetReachability != NetworkReachability.NotReachable)
     {
                     #if UNITY_ANDROID
         PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
                                               .EnableSavedGames()
                                               .Build();
         PlayGamesPlatform.InitializeInstance(config);
         PlayGamesPlatform.DebugLogEnabled = true;
         PlayGamesPlatform.Activate();
                     #endif
         Social.localUser.Authenticate(success => {
             if (success)
             {
                 Debug.Log("Authentication successful");
             }
             else
             {
                 Debug.Log("Authentication failed");
             }
         });
     }
 }
Exemplo n.º 2
0
    void Start()
    {
        if (!trackingEnabled)
        {
            return;
        }

        // Google Analytics
        if (useGoogleAnalytics && googleAnalyticsTracker != null)
        {
            // Start session
            googleAnalyticsTracker.StartSession();
        }

        // Start session
        // The id is set in "Edit > Project Settings > Player" (as the cloud id)

        // Custom tracking: platform
        trackCustomEventPlatform();

        // Custom tracking: application
        trackCustomEventApplication();

        // Custom tracking: device
        trackCustomEventDevice();

        // Custom tracking: user
        trackCustomEventUser();

        // TODO: performance (average fps, lowest fps)
    }
		public static void Setup( bool enable, Dictionary<string, string> parameters ) {
			if(initialized) {
				return;
			}

			initialized = true;

			if(enable == false) {
				return;
			}

			//start the SDK
			try {
				ga = GoogleAnalyticsV3.getInstance( );
				ga.StartSession( );
			}
			catch(System.Exception e) {
				UnityEngine.Debug.LogError( "Error at setup google analytics" + e );
				return;
			};

			enabled = true;
			//attach to the main events catcher for the entire session
			Analytics.trackEventListeners += TrackEvent;
			Analytics.trackScreenListeners += TrackScreen;

			//make sure the Google Analytics Class Instance is not
			//destroyed when the scene is changed.
			MonoBehaviour.DontDestroyOnLoad( ga.gameObject );
		}
Exemplo n.º 4
0
 void Start()
 {
     // Start Session Google Analytics
     GA.StartSession();
     // Request banner Google Admob
     GoogleMobileAdsScript.advertise.RequestBanner();
 }
Exemplo n.º 5
0
    // Use this for initialization
    void Start()
    {
        splashImage = gameObject.GetComponent <Image> ();
        DontDestroyOnLoad(this);

        googleAnalytics.StartSession();
        googleAnalytics.LogScreen("Splash");
        googleAnalytics.DispatchHits();
        //googleAnalytics.
    }
Exemplo n.º 6
0
    public void StartSession()
    {
        if (sessionStarted)
        {
            return;
        }

        sessionStarted = true;
        googleAnalytics.StartSession();
        googleAnalytics.LogScreen("Game Start");
    }
Exemplo n.º 7
0
 // Use this for initialization
 void Start()
 {
     if (isAnalyticsEnabled && googleAnalytics != null)
     {
         googleAnalytics.DispatchHits();
         googleAnalytics.StartSession();
     }
     else
     {
         googleAnalytics = null;
     }
 }
Exemplo n.º 8
0
 // Use this for initialization
 void Start()
 {
     replayCoroutineDone = true;
     GameSaveSystem.Instance.LoadGame();
     AutoTimeMode();
     BackDropSwap.Instance.Swap(timeMode);
     CalculateHeight();
     InitializeGlobalTime();
     googleAnalytics.StartSession();
     AchievementMonitor.Instance.AParams.noOfSessions++;
     googleAnalytics.LogEvent("Game", "Language", versionName, 0);
 }
Exemplo n.º 9
0
    void Start()
    {
        // Google Analytics
        if (useGoogleAnalytics && googleAnalyticsTracker != null)
        {
            // Start session
            googleAnalyticsTracker.StartSession();
        }

        // Unity Analytics
        if (useUnityAnalytics)
        {
            // Start session
            UnityAnalytics.StartSDK(unityAnalyticsAppId);

            // Custom tracking: platform
                        #if UNITY_EDITOR
            trackUACustomEventPlatform("editor");
                        #elif UNITY_IPHONE
            trackUACustomEventPlatform("ios");
                        #elif UNITY_ANDROID
            trackUACustomEventPlatform("android");
                        #elif UNITY_STANDALONE_OSX
            trackUACustomEventPlatform("osx");
                        #elif UNITY_STANDALONE_WIN
            trackUACustomEventPlatform("windows");
                        #elif UNITY_WEBPLAYER
            trackUACustomEventPlatform("web");
                        #elif UNITY_WII
            trackUACustomEventPlatform("wii");
                        #elif UNITY_PS3
            trackUACustomEventPlatform("ps3");
                        #elif UNITY_XBOX360
            trackUACustomEventPlatform("xbox360");
                        #elif UNITY_FLASH
            trackUACustomEventPlatform("flash");
                        #elif UNITY_BLACKBERRY
            trackUACustomEventPlatform("blackberry");
                        #elif UNITY_WP8
            trackUACustomEventPlatform("windows-phone-8");
                        #elif UNITY_METRO
            trackUACustomEventPlatform("windows-metro");
                        #else
            trackUACustomEventPlatform("unknown-" + Application.platform);
                        #endif

            // Custom tracking: user
            trackUACustomEvent("user", "os_language", Application.systemLanguage);
        }
    }
    public GoogleAnalyticsAdaptor()
    {
        var config = Config.Find<GoogleAnalyticsConfig>();
        if(config == null)
        {
            EngineRoot.Instance.RemoveModule(this);
            return;
        }

        ga = UnityRoot.Instance.gameObject.AddComponent<GoogleAnalyticsV3>();

        ga.IOSTrackingCode = config.IOSTrackingCode;
        ga.androidTrackingCode = config.androidTrackingCode;
        ga.otherTrackingCode = config.otherTrackingCode;
        ga.productName = config.productName;
        ga.bundleIdentifier = config.bundleIdentifier;
        ga.bundleVersion = config.bundleVersion;
        ga.sendLaunchEvent = config.sendLaunchEvent;
        ga.logLevel = GoogleAnalyticsV3.DebugMode.VERBOSE;
        ga.sendLaunchEvent = true;

        ga.StartSession();
    }
Exemplo n.º 11
0
    // Use this for initialization
    void Start()
    {
        DontDestroyOnLoad(analytic.gameObject);

        analytic.StartSession();
    }
Exemplo n.º 12
0
 // Use this for initialization
 void Start()
 {
     googleAnalytics.StartSession();
 }