Collect User Data from Game and Export it

So I’ve built a game for the HTML platform and now I want to collect some user data from the game for instance number of keys pressed in a level. Any idea how can I do that and export that data to my personal website in an excel sheet format?