//private string locale = null; public GoedleAnalytics( string api_key, string app_key, string user_id, string app_version, string ga_tracking_id, string app_name, int cd1, int cd2, string cd_event, GoedleHttpClient gio_http_client, IGoedleWebRequest gwr, IGoedleUploadHandler guh, bool staging, bool adaptation_only) //, string locale) { _api_key = api_key; _app_key = app_key; _user_id = user_id; _app_version = app_version; _ga_tracking_id = ga_tracking_id; _app_name = app_name; _cd1 = cd1; _cd2 = cd2; _cd_event = cd_event; _gio_http_client = gio_http_client; _gwr = gwr; _staging = staging; _adaptation_only = adaptation_only; //this.locale = GoedleLanguageMapping.GetLanguageCode (locale); track_launch(guh); }
public void track(string event_name, string event_id, string event_value, bool launch, string trait_key, string trait_value) { GoedleHttpClient outer = new GoedleHttpClient(); string[] pass = null; int ts = getTimeStamp(); // -1 because c# returns -1 for UTC +1 , * 1000 from Seconds to Milliseconds int timezone = (int)(((DateTime.UtcNow - DateTime.Now).TotalSeconds) * -1 * 1000); GoedleAtom rt = null; if (launch == true) { rt = new GoedleAtom(app_key, this.user_id, ts, event_name, event_id, event_value, timezone, GoedleConstants.BUILD_NR); } else { rt = new GoedleAtom(app_key, this.user_id, ts, event_name, event_id, event_value, trait_key, trait_value); } if (rt == null) { Console.Write("Data Object is None, there must be an error in the SDK!"); } else { pass = encodeToUrlParameter(rt.getGoedleAtomDictionary()); } outer.send(pass); }
public void SetUp() { _app_key = "test_app_key"; _user_id = "u1"; _app_version = "v_test"; _ts = 0; _app_name = "test_app"; _timezone = 360000; _event_name = "test_event"; _event_id = null; _event_value = null; _ga_active = false; _anonymous_id = null; _trait_key = null; _trait_value = null; _api_key = "test_api_key"; _GA_TRACKIND_ID = null; _GA_CD_1 = 0; _GA_CD_2 = 0; _GA_CD_EVENT = "group"; _url = "test_url"; _staging = false; _gio_http_client = (new GameObject("GoedleHTTPClient")).AddComponent <GoedleHttpClient>(); _guh = Substitute.For <IGoedleUploadHandler>(); _gw = Substitute.For <IGoedleWebRequest>(); }
public void track(string event_name, string event_id, string event_value, bool launch, string trait_key, string trait_value) { GoedleHttpClient outer = new GoedleHttpClient(); bool ga_active = !String.IsNullOrEmpty(this.ga_tracking_id); string[] pass = null; int ts = getTimeStamp(); // -1 because c# returns -1 for UTC +1 , * 1000 from Seconds to Milliseconds int timezone = (int)(((DateTime.UtcNow - DateTime.Now).TotalSeconds) * -1 * 1000); GoedleAtom rt = new GoedleAtom(this.app_key, this.user_id, ts, event_name, event_id, event_value, timezone, app_version, this.anonymous_id, trait_key, trait_value, ga_active); if (rt == null) { Console.Write("Data Object is None, there must be an error in the SDK!"); } else { pass = encodeToUrlParameter(rt.getGoedleAtomDictionary()); } outer.send(pass); // Sending tp Google Analytics for now we only support the Event tracking string type = "event"; if (ga_active) { trackGoogleAnalytics(event_name, event_id, event_value, type); } }
void Awake() { //Check if instance already exists if (instance == null) { //if not, set instance to this instance = this; } //If instance already exists and it's not this: else if (instance != this) { //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager. Destroy(gameObject); } //Sets this to not be destroyed when reloading scene DontDestroyOnLoad(gameObject); }