Question: Is there a way to use Wolfram Cloud to create a web API function that, when pinged, does the following:
Gets the geographical location of the user (as an Wolfram entity, like
Germanyinstead of raw coordinates) and adds to a tally of site visitors by location (probably as a Wolfram Association)? Something roughly of form
<| "California, USA" -> 2, "Germany" -> 1, ... |>. It doesn't have to be like this, but this just seems natural at first glance.
Returns text to the user who curls it?
Example. So for example of a user does something like
the response in their console should be
Welcome to my webpage!
and, internally, some Wolfram Association with the geographical data should be updated so that I can check my account to see how many people visited us/where it came from.
Attempt. The following functions seem useful:
GeoLocation (problem: returns coordinates and not entity locations).