// Use this for initialization void Start () { RequestBanner(); var props = new Value(); props["admobunitid"] = adBannerId; props["event"] = "admob-showbanner"; Mixpanel.Track("admob-banner", props); }
private void GoToCombinationEquipmentRecipe(int recipeId) { Mixpanel.Track("Unity/Click Guided Quest Combination Equipment"); CombinationClickInternal(() => Find <Combination>().ShowByEquipmentRecipe(recipeId)); }
public void FakeLogin() { // API APIController.SavePlayer(player.PlayerId, player.Name.Replace(" ", "%20"), player.AccessToken); // HeroicLabs Client.ApiKey = "31c210da7f0b4110bc301544870733d6"; Client.Ping(onError); Client.LoginOAuthFacebook(player.AccessToken, (SessionClient session) => { MPScript.Data.SessionClient = session; MPScript.Data.SessionClient.Gamer((Gamer gamer) => { string nickname = player.Name.Replace(' ', '_'); if (gamer.Nickname != nickname) { MPScript.Data.SessionClient.UpdateGamer(nickname, onSuccess, onError); } }, onError); }, onError); // Mixpanel Mixpanel.DistinctID = player.PlayerId; Mixpanel.SendEvent("DevSkip Login"); }
public override void Show(bool ignoreShowAnimation = false) { base.Show(ignoreShowAnimation); Mixpanel.Track("Unity/LoginImpression"); for (var i = 0; i < slots.Length; i++) { var slot = slots[i]; var playerSlot = slot.GetComponent <LoginPlayerSlot>(); if (States.Instance.AvatarStates.TryGetValue(i, out var avatarState)) { playerSlot.LabelLevel.text = $"LV.{avatarState.level}"; playerSlot.LabelName.text = avatarState.NameWithHash; playerSlot.CreateView.SetActive(false); playerSlot.NameView.SetActive(true); } else { playerSlot.CreateView.SetActive(true); playerSlot.NameView.SetActive(false); } } AudioController.instance.PlayMusic(AudioController.MusicCode.SelectCharacter); }
public override void ViewDidLoad() { base.ViewDidLoad(); // Perform any additional setup after loading the view, typically from a nib. var stringBuilder = new StringBuilder(); stringBuilder.AppendLine($"Mixpanel version: {Mixpanel.LibVersionStatic}"); var mixpanel = Mixpanel.SharedInstanceWithToken("YOUR_TOKEN"); // Adding this will allow us to see Mixpanel is trying to function even though it has an invalid token. mixpanel.EnableLogging = true; mixpanel.Track("This Event Happened"); // This exists for Android but there does not seem to be a similar method call for iOS. /* * stringBuilder.AppendLine("Device info:"); * foreach (var deviceInfo in mixpanel.DeviceInfo) * { * stringBuilder.AppendLine($" - {deviceInfo.Key}: {deviceInfo.Value}"); * } */ MainTextView.Text = stringBuilder.ToString(); }
private void Awake() { // Pseudo singleton mechanism if (instance != null) { // There is no need for more than one Tracking Game Object Destroy(gameObject); return; } // Make this gameobject persist across the session DontDestroyOnLoad(this); instance = this; // Reference the Mixpanel component mixpanelComponent = GetComponent <Mixpanel>(); // Make basic checks if (mixpanelComponent.token == "" || mixpanelComponent.debugToken == "") { Debug.LogError("No public or private token defined on Mixpanel component.", gameObject); return; } // Enable the Mixpanel component (disabled by default) mixpanelComponent.enabled = true; }
void OnGUI() { GUI.skin = this.skin; GUILayout.BeginArea(new Rect(Screen.width * 0.3f, Screen.height * 0.35f, Screen.width * 0.4f, Screen.height * 2.5f)); if (GUILayout.Button("Track")) { // a simple tracking call Mixpanel.Track("The Button Was Clicked1"); } if (GUILayout.Button("Engage")) // an engage call { Mixpanel.people.Increment("clicks", 1); } if (GUILayout.Button("Opt Out Tracking")) // an engage call { Mixpanel.OptOutTracking(); // EditorUtility.DisplayDialog("Opt status", "Has opted out: " + Mixpanel.hasOptedOut() , "Ok"); } if (GUILayout.Button("Opt In Tracking")) // an engage call { Mixpanel.OptInTracking(); // var args1 = new Value(); // args1["test"] = 100; // args1["me"] = 101; // Mixpanel.OptInTracking("newDisctinctId2", args1); // EditorUtility.DisplayDialog("Opt status", "Has opted out: " + Mixpanel.hasOptedOut() , "Ok"); } GUILayout.EndArea(); }
public void CreateAndLogin(string nickName) { if (!Regex.IsMatch(nickName, GameConfig.AvatarNickNamePattern)) { Find <Alert>().Show("UI_ERROR", "UI_NICKNAME_CONDITION"); return; } Mixpanel.Track("Unity/Choose Nickname"); Find <GrayLoadingScreen>().Show(); Game.Game.instance.ActionManager .CreateAvatar(_selectedIndex, nickName, _hair, _lens, _ear, _tail) .Subscribe(eval => { var avatarState = States.Instance.SelectAvatar(_selectedIndex); StartCoroutine(CreateAndLoginAnimation(avatarState)); ActionRenderHandler.Instance.RenderQuest(avatarState.address, avatarState.questList.completedQuestIds); //[TentuPlay] new TPStashEvent().CharacterLogin( player_uuid: States.Instance.AgentState.address.ToHex(), character_uuid: States.Instance.CurrentAvatarState.address.ToHex().Substring(0, 4) ); }, e => { ActionRenderHandler.PopupError(e); Find <GrayLoadingScreen>().Close(); }); AudioController.PlayClick(); }
public void DropComplete(bool value) { if (!value) { return; } dropCompleteCounter += 1; // if all objects have dropped, graph line chart if (dropCompleteCounter == objectsList.Count) { graphCreator.CreateGraph(); dropCompleteCounter = 0; // show feedback if (gameController) { gameController.ShowFeedbackPopup(10); } // track var props = new Value(); props["Scene Name"] = SceneManager.GetActiveScene().name; Mixpanel.Track("Ran Simulation", props); } }
void Start() { if (UnityEngine.XR.XRDevice.model == "Oculus Quest") { controllerRayCaster.RayCastEnabled = true; controllerRayCaster.EnableLineRenderer(true); } // once we have registered users we can use a better ID Mixpanel.Identify(getUniqueID()); Mixpanel.People.Set("Headset", UnityEngine.XR.XRDevice.model); // set random name Mixpanel.People.SetOnce("$name", getRandomName()); var props = new Value(); props["Scene Name"] = SceneManager.GetActiveScene().name; Mixpanel.Track("Opened Scene", props); //Mixpanel.StartTimedEvent("App Session"); if (PlayerPrefs.GetInt("hasEnteredWelcomeEmail") == 1) { feedbackPopup.SetActive(false); } else { feedbackPopup.SetActive(true); } TouchHaptics.Instance.VibrateFor(0.25f, 0.2f, 0.2f, OVRInput.Controller.Touch); }
public void PowerButtonPress() { if (!powerOn) { powerOn = true; powerText.text = "Power On"; mainLight.TurnOn(true); //setCurrents(sliderControl.SliderValue); currentQueue.Add(sliderControl.SliderValue); } else { powerOn = false; powerText.text = "Power Off"; mainLight.TurnOn(false); //setCurrents(0); currentQueue.Add(0); // show feedback popup if (gameController) { gameController.ShowFeedbackPopup(5); } } var props = new Value(); props["Scene Name"] = SceneManager.GetActiveScene().name; props["Power On"] = powerOn; Mixpanel.Track("Power Button Press", props); }
public void End() { PlayerFactory.Create(); if (PlayerPrefs.HasKey(LoginDetail.RecentlyLoggedInAvatarKey)) { var recentlyLoggedAddress = PlayerPrefs.GetString(LoginDetail.RecentlyLoggedInAvatarKey); var matchingAddress = State.States.Instance.AgentState.avatarAddresses .FirstOrDefault(pair => pair.Value.ToString().Equals(recentlyLoggedAddress)); var index = matchingAddress.Equals(default(KeyValuePair <int, Address>)) ? -1 : matchingAddress.Key; try { State.States.Instance.SelectAvatar(index); Game.Event.OnRoomEnter.Invoke(false); } catch (KeyNotFoundException e) { Debug.LogWarning(e.Message); EnterLogin(); } } else { EnterLogin(); } Mixpanel.Track("Unity/Synopsis End"); Close(); }
public void HandleOnAdLeavingApplication(object sender, EventArgs args) { var props = new Value(); props["admobunitid"] = adBannerId; props["event"] = "admob-showbanner-leaveapp"; Mixpanel.Track("admob-banner-event", props); }
public void HandleOnAdClosed(object sender, EventArgs args) { var props = new Value(); props["admobunitid"] = adBannerId; props["event"] = "admob-showbanner-closed"; Mixpanel.Track("admob-banner-event", props); }
//tracking overall player progress: sent every time the player loads up crafting public static void Progress() { Mixpanel.SendEvent("Progress", new Dictionary <string, object> { { "Elements Unlocked", GlobalVars.NUMBER_ELEMENTS_UNLOCKED }, { "Highest Tier", Utility.HighestTierUnlocked() } }); }
private IEnumerator showFeedbackPopupCoroutine(float delaySeconds) { yield return(new WaitForSeconds(delaySeconds)); // instantiate feedback popup feedbackPopup = (GameObject)Instantiate(feedbackPopupPrefab, new Vector3(0, 0, 0), Quaternion.identity); feedbackPopup.GetComponent <FeedbackPopupController>().GameController = this; positionPopup(feedbackPopup); if (audioSource) { audioSource.clip = showFeedbackPopupClip; audioSource.Play(); } // set to seen PlayerPrefs.SetInt("hasSeenFeedbackPopup", 1); // vibrate both controllers TouchHaptics.Instance.VibrateFor(0.25f, 0.2f, 0.2f, OVRInput.Controller.Touch); popUpOpen = true; var props = new Value(); props["Scene Name"] = SceneManager.GetActiveScene().name; Mixpanel.Track("Shown Feedback Popup", props); }
void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { Mixpanel.SendEvent("Completed level " + level); } }
/// <summary> /// Tracks the event with a dictionary of event info. /// </summary> public void TrackEvent(string eventName, Dictionary <string, object> eventInfo) { if (this.Options == null || this.Options.Mode == AnalyticsMode.Disabled) { return; } if (!this.MixpanelInitialized) { // We do not wait for this coroutine to finish because // we want the first event, App Started, to definitely be // the first event sent, and be timed correctly. // The coroutine will begin the process of collecting // the installed apps (incl. downloading the list of apps // to check for), so that info will be available only // on later events. this.StartCoroutine(this.ConfigureMixpanelAsync()); this.MixpanelInitialized = true; } if (this.Native && this.Native.HasMixpanel) { this.Native.MixpanelEvent(eventName, eventInfo); } else { Mixpanel.SendEvent(eventName, eventInfo); } }
//when the players crafts their first element for the tutorial public static void CraftedFirstElement(string newElement) { Mixpanel.SendEvent("Crafting An Element For Crafting Tutorial", new Dictionary <string, object> { { "Element", newElement } }); }
public IObservable <ActionBase.ActionEvaluation <CombinationEquipment> > CombinationEquipment( int recipeId, int slotIndex, int?subRecipeId = null) { Mixpanel.Track("Unity/Create CombinationEquipment"); // 결과 주소도 고정되게 바꿔야함 var action = new CombinationEquipment { AvatarAddress = States.Instance.CurrentAvatarState.address, RecipeId = recipeId, SubRecipeId = subRecipeId, SlotIndex = slotIndex, }; ProcessAction(action); return(_renderer.EveryRender <CombinationEquipment>() .Where(eval => eval.Action.Id.Equals(action.Id)) .Take(1) .Last() .ObserveOnMainThread() .Timeout(ActionTimeout) .DoOnError(e => HandleException(action.Id, e))); }
// Exampe people property // Common setup for the first use private static void FirstUse(string date, string distinct_id) { Mixpanel.SendPeople(new Dictionary <string, object> { { "First Use", date }, { "distinct_id", distinct_id }, }, "set_once"); }
//event for using a powerup public static void PowerUpUsed(string powerUpName, int powerUpLevel) { Mixpanel.SendEvent("Power Up Used", new Dictionary <string, object> { { "Power Up", powerUpName }, { "Level", powerUpLevel } }); }
public void NextArrowSelected() { var properties = new Value(); SetAppState(properties); Mixpanel.Track("Next Posts Selected", properties); }
public void PreviousArrowSelected() { var properties = new Value(); SetAppState(properties); Mixpanel.Track("Previous Posts Selected", properties); }
public void CommentUploaded() { var properties = new Value(); SetAppState(properties); Mixpanel.Track("New Comment Added To Post", properties); }
public void FollowSelected() { var properties = new Value(); SetAppState(properties); Mixpanel.Track("Began Following User", properties); }
//when the player enters the powerup menu for the tutorial public static void EnteredPowerUpMenu() { if (CraftingTutorialController.CurrentTutorial == MainMenuController.Tutorial.UpgradePowerup && CraftingTutorialController.TutorialActive) { Mixpanel.SendEvent("Opened PowerUp Menu For Buy Power Up Upgrade Tutorial", new Dictionary <string, object>()); } }
//when the player opens the crafting menu for the tutorial public static void EnteredCraftingMenu() { if (CraftingTutorialController.CurrentTutorial == MainMenuController.Tutorial.Crafting && CraftingTutorialController.TutorialActive) { Mixpanel.SendEvent("Opened Crafting Menu For Crafting Tutorial", new Dictionary <string, object>()); } }
//when the player drags four elments in and the game is ready to launch public static void DraggedElementsInForLaunchGatheringTutorial() { if (CraftingTutorialController.CurrentTutorial == MainMenuController.Tutorial.Gathering && CraftingTutorialController.TutorialActive) { Mixpanel.SendEvent("Dragged Elements in For Launch Gathering Mission Tutorial", new Dictionary <string, object>()); } }
//not currently in use, sent every time a player crafts an element public static void ElementCreated(string newElement, string parent1, string parent2, bool isNew) { Mixpanel.SendEvent("Element Created", new Dictionary <string, object> { { "Element", newElement }, { "Combination", parent1 + " + " + parent2 }, { "Is New", isNew } }); }
internal static void Init() { try { //This version displays the real binding error var mixpanel = new Mixpanel(YourMixPanelId, 1); //This is the recommended version to use when the binding works. //It returns null if the binding does not work. //var mixpanel = Mixpanel.SharedInstanceWithToken(YourMixpanelId); Debug.WriteLine("Mixpanel initialized DistinctId {0}", (object)mixpanel.DistinctId); } catch(Exception e) { Debug.WriteLine ("Error in Mixpanel SDK: {0}", (object)e.ToString()); } }