The "technique" is here is so simple that it almost doesn't deserve to be called as such: you just record the data from game systems you think are relevant.
How you record that data (to a database, to files, whatever) is too broad to discuss here, as is the question of which systems are relevant. There are no clever automatic techniques to answer those questions; that would be quite the feat of artificial intelligence.
The thing you want to make sure of with a game where there is a server component is that the server should do all the logging it can. Nothing you get from the client can be trusted, and especially if you're going to be using this data to tailor changes to the game you don't want players to be able to tamper with it.
The client should only record and transmit statistics that the server wouldn't normally have access too. For example of you want to record UI click heat maps, that's probably only feasible on the client.