About Game Statistic

I will sell my game on steam , but i really need feedback I’m thinking of adding stats to the game for this ,
ex ;
Which item does the player buy the most?
In which section does the actor spend the most time?
In which scene does the actor stand alone the most?
something like that

but I don’t know how to transfer it to a database, how to look from there
I need your help and ideas for this

Thank you ^^

disclaimer: I’m only aware about basic theory, but don’t know the best practices

That thing is also known as “Telemetry”.

At the simplest case you have a DB(like mysql or postgres) with a simple http server(nodejs or any other language you like) which accept http requests with data from your application and store it into DB.

You should also handle a legal side of question, but i don’t know too much about it.

Hope it helps you google your question further