My plan's to develop a module for easy customer KPI handling across projects. It should consist of a small SDK to put 2-3 lines of code in the project, a "template"/model for a SQL table (code first DB) and a small frontend to see the most crucial things like clicks/item and so on.
I thought about storing everything in the same table - user, timestamp, action type and context (like item ids). As you can imagine it's pretty hard to do more complex calculations because context can differ.
Second approach - make tables per action type. This will make it hard to prepare a module because it differs from project to project.
What do you recommend? Are there any best practices on this topic?