If i wanted to make a leaderstats column for purchases in my game, how would i do that?

i dont know how to identify every time a player buys something and also saving it. this is for a hair combo game so there are tons and tons of different hats

have all the hats with specific ID, and when saving player data, add the owned hats to a table and save that table