About add a new metric

Matomo is a good product, but i have a question, how should i add a new metric for analyse?
via create a new plugins or else others way?


If you simply want to store an additional number to every pageview or visit then Custom Dimensions are the way to go: