1
\$\begingroup\$

In my game the user can change the language of the game and I'd like to know how many people play it in English, German, etc.

I'm using Unity, so possibly I would like to implement in Unity Analytics.

I was thinking about adding segments for the languages, but in that case if a user tries all languages, the user will appear in all languages' segments. So it won't really provide that much info.

A possible solution:

  • When the user changes language, we signal a database to decrease the old language's counter and increase the new language's counter.

But there must be an easier, built-in solution than this.

\$\endgroup\$
2
  • \$\begingroup\$ I think you're overstating how many languages one person tries. At most they will try one or two. You could even get a dimension for how many languages they have tried so you can see how accurate your language metric is \$\endgroup\$ Mar 27, 2021 at 22:20
  • \$\begingroup\$ Well, you're right, it's good enough for a start. \$\endgroup\$
    – Tudvari
    Mar 28, 2021 at 8:18

1 Answer 1

0
\$\begingroup\$

Possibly you could do something like:

if (languages.language = languages.English)
{
    englishNumber += 1.0f;
}

for English, and for each player. This way, for each player with English as their language, englishNumber is increased by 1. Then take that number and set into a database that will be changed by all users, so nobody is left out. So if there are 58 players using "English", and each one adds +1 to englishNumber (note that I mean they all add "+1" to the same englishNumber variable), then the result is that englishNumber would equal 58.

\$\endgroup\$
5
  • \$\begingroup\$ Can you recommend steps to implement this englishNumber using Unity Analytics? \$\endgroup\$
    – DMGregory
    Mar 31, 2021 at 19:02
  • \$\begingroup\$ Well, I'm not exactly a pro at Unity Analytics itself, I'm just saying as long as they know how to complete the Unity Analytics part, they could consider using the example I provided to add +1 for every player using the specified language. \$\endgroup\$ Mar 31, 2021 at 19:16
  • \$\begingroup\$ @DMGregory does the Gem next to your name mean that you're a Moderator? \$\endgroup\$ Mar 31, 2021 at 19:18
  • 1
    \$\begingroup\$ Since the question asks how to do this with Unity Analytics, it might be wise to research that API and test your suggestion before posting an answer. Chances are, it's not the "adding one to a variable inside an if" part that this user is having trouble with. And yes, that is what the gem means. \$\endgroup\$
    – DMGregory
    Mar 31, 2021 at 19:27
  • \$\begingroup\$ Yes, this is what I thought of in the original post as well, but I'd like to do it with analytics, so I don't have to have a backend just for this. :\ Sadly I couldn't figure out how to make a similar behaviour work in analytics myself, so I've just sticked with Panda Pajama's answer at the original post. \$\endgroup\$
    – Tudvari
    Apr 1, 2021 at 8:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .