How do track users' data in MVC APP or in APIs?

Hi Apart from using Google Analytics or Web Analytics in ReactApp or in Angular App to track user data, how do we track in API's or in MVC application. Please can someone help me out, any resources, or give me certain ideas? Thank you.
3 Replies
13eck
13eck13mo ago
MVC and APIs are more a #back-end thing than front-end. But one thing you could do is to assign an ID to track their useage of your API. That's how a lot of commercial APIs do it: you get an API key that not only tracks your useage (for rate limits or price-per-use) but also to validate your ability to use the API. If you're only looking to get usage data you can make a random, time-based hash as a cookie and track that as your API is used. Be sure that it's anonymous and can't be tracked back to them or else you'll need a cookie tracking policy (GDPR and the like). But as I am not a lawyer, you'll want to discuss with one if you have tracking on your site.
SureshPasham
SureshPasham13mo ago
Any resource or sample?
13eck
13eck13mo ago
None that I'm aware of, no. And if you're using a front-end framework that intercepts server calls and renders it all on the client then you'll have to find something for that framework to use.