コード例 #1
0
        //--------------------------------------
        // INITIALIZE
        //--------------------------------------


        void Awake()
        {
            if (Instance != null)
            {
                DestroyImmediate(gameObject);
                return;
            }
            else
            {
                Instance = this;
                DontDestroyOnLoad(gameObject);
            }

            name = "Google Analytics";



            GenerateClientId();
            cleint = new Client(_ClientId);


            if (!IsSessionStarted)
            {
                Client.CreateHit(HitType.SCREENVIEW);
                Client.StartSession();
                Client.SetUserLanguage(Application.systemLanguage.ToString());
                Client.SetScreenResolution(Screen.width, Screen.height);
                Client.Send();

                IsSessionStarted = true;
            }

            SendFirstScreenHit();
            SubmitSystemInfo();



            if (GA_Settings.Instance.AutoExceptionTracking)
            {
                                #if UNITY_3_5 || UNITY_4_0 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_4_7
                Application.RegisterLogCallback(HandleLog);
                                #else
                Application.logMessageReceived += HandleLog;
                                #endif
            }

            if (GA_Settings.Instance.AutoCampaignTracking)
            {
                AndroidTools.RequestReffer();
            }



                        #if UNITY_EDITOR
            if (GA_Settings.Instance.UsePlayerSettingsForAppInfo)
            {
                GA_Settings.Instance.AppName    = PlayerSettings.productName;
                GA_Settings.Instance.AppVersion = PlayerSettings.bundleVersion;
            }
                        #endif

                        #if UNITY_4_6 || UNITY_4_7 || UNITY_5_0 || UNITY_5_1 || UNITY_5_2 || UNITY_5_3
                        #else
            SceneManager.sceneLoaded += (Scene arg0, LoadSceneMode arg1) => {
                TrackNewLevel();
            };
                        #endif
        }
コード例 #2
0
 public static void RequestReffer()
 {
     AndroidTools.CallStatic(ReferalIntentReciever, "RequestReferrer");
 }