How do you track player gameplay statistics?

I am trying to figure out how to make a game manager for tracking statistics however when ever I search this topic it comes up with RPG attributes. Unfortunately “stats” and “attributes” have become completely conflated and I can’t find any information on tracking actual statistics. So I need to be pointed in the right direction with any lingo that you forum pros may know of.

To clarify I’m not looking for Unity analytics and I don’t want computer statistics such as frames per second. I’m looking for something more like an in game achievement however achievements are normally single events like “Reached the top of the mountain” or “reached XX meters high” which could update as new heights are reached. That’s fine but I want to know the best way to capture more analytical data that could be displayed in a menu for both serious and fun little things. Think of the Statistics menu in an old spider-man game that told you how many steps you had taken, how many webs you had shot, and how many meters you had swung etc. Or the Statistics in Horizon Zero Dawn that has game progression and statistics menus (and yet searching the web for their statistics menu yields no results :\ ). They tell you how many people you killed, how many where head shots, how many side quests you completed, how many camp fires activated etc etc. Not Trophy’s not achievements just player statistical data-points. Yes Anylitics is close to what i am looking for but I want to report these to the player rather then hide them and require a raw data export for me to view.

Have any of you done this? What suggestions would you have for someone researching how to accomplish this? Should I just hink of them as Achievements and Trophy’s?

Thanks.

Analytics is the first thing I use to track this, as you can create custom metrics to follow, allowing the tracking of all of what it sounds like you want. But that does miss the requirement that it needs to be on the client machine. This would be similar to Experience in for an RPG game. It becomes a variables saved with the save game files. You could look into PlayerPrefs, and increment the values you want as you go. Then later on, you can retrieve them to use on the client only. Here is an example:

public void IncrementStat(string statName)
{
  // potentially insert line here to push this to analytics if you want to see it as well.  
  var val = PlayerPrefs.GetInt(statName);  // will default to zero if it doesn't exist.
  val++;
  PlayerPrefs.SetInt(statName, val);
}

public int GetStat(string statName)
{
  return PlayerPrefs.GetInt(statName);
}