Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Custom Question

Discussion in 'GameTune' started by Egil-Sandfeld, Oct 8, 2019.

  1. Egil-Sandfeld


    Oct 8, 2012
    Hello again :)

    Getting accustomed to GT, I want to ask when to display a banner for the user to click on, that will take them to rate the app. The banner is a simple overlay with a button to rate the app, and another one to dismiss the banner overlay and carry on.

    In GT Dashboard I have created a Custom Question like this:

    Notice the "Revenue" in order to get "Maximize Conversion" seems weird to me. I'm not trying to increase revenue here. I'm trying to get users to click a button. (Let me know if there's another way to do this).

    Anyway, in code I have this:

    Code (CSharp):
    2. private void AskQuestions()
    3. {
    4.      WhenToShowRatingBanner = GameTune.CreateQuestion(
    5.      "WhenToShowRatingBanner",
    6.      new string[] { "3", "2", "4", "5", "6", "7" },
    7.      AnswerType.NEW_UNTIL_USED,
    8.      WhenToShowRatingBannerAnswer
    9.      );
    10. }
    12. private void WhenToShowRatingBannerAnswer(Answer answer)
    13. {
    14.      AnswerWhenToShowRatingBanner = answer;
    15.      OnAnswerWhenToShowRatingBanner?.Invoke(answer);
    16.      LogAnswer(answer);
    17. }
    19. private void OnAnswerWhenToShowTheRateAppBanner(Answer answer)
    20. {
    21.       GameTuneController.OnAnswerWhenToShowRatingBanner -= OnAnswerWhenToShowTheRateAppBanner;
    22.       answer.Use();
    23.       if (!int.TryParse(answer.Value, out soSettings.appStartsBeforeRateAppBannerShows))                                     Debug.LogError("Could not parse OnAnswerWhenToShowTheRateAppBanner answer: " + answer.Value);
    24.       else
    25.           soSettings.SaveToPersistence();
    26. }
    The answer is used immediately when returned as I want to "start the experiment". The values in the answer represent app session starts, so if the answer returns "6", the banner will be shown once on or after the 6th app start.

    If the user clicks on the banner to go rate the app, the following is triggered:

    Code (CSharp):
    1. public void RateTheApp()
    2. {  
    3.     UnityEngine.GameTune.GameTune.RewardEvent("AppRated");
    4. }

    • How does this approach look to you? Have I set up the Question rewards correctly?
    • Is this the intended usage of "Use" when the reward can be several sessions and days later?
    • Either I'm doing it wrong in GT Dashboard, or the wording of "revenue" for a custom reward is bad. Which one is it? :)
  2. kosmikko


    Unity Technologies

    Jan 30, 2018
    Hi, sorry for the confusion, we'll try to improve this. For now we've added some documentation regarding the configuration

    Dashboard configuration looks correct for your use case, Maximize conversion is the correct optimization target. Use should be called only when you are about to display the banner to the user, otherwise use may churn before seeing it and GameTune wouldn't learn that.
    Egil-Sandfeld likes this.
  3. Egil-Sandfeld


    Oct 8, 2012
    Thanks for the reply, Kosmikko.

    Had a think about that today, of how I would store the answer until it got used. I tried storing the Answer into a scriptableObject and serializing that in persistence until the session that it was used.

    Then I remembered, that I can Use the question instead of an Answer by specifiying the alternative used. That made it much easier :D