In a flask web application with a PostGres database, I want to get the country of a user when they register and save it to the database. I am trying to do this with google analytics/ GA api on their free tier.
I could not find any documentation showing how to this online.
Not the right usage of the tool.
Use geolocation ip tables to determine the country in the runtime. Or a specialized API.
GA has the data api and it could theoretically give you that data, but only if you wouldn’t mind a delay of up to two days minus all the users who are sane enough to use adblockers. Plus you’d need to make sure you have separate tracking to identify users since Google isn’t eager to share its client id with you or allow you to select by it.
In short: GA’s not the right tool for this.