User analytics - How to get user's IP?

Hello,

I’d like to put in place user analytics. For example starting with from which country a user would connect. Xano can work with “$http_headers” variable to determine location but I don’t know how to collect it from Weweb. Does someone know ?

In addition, what do you recommend as a user analytics plugin ?

Thank you

You can use it in a scenario like this. All you need to do is call the xano endpoint from weweb, it would get the details from the request. And regarding plugin i usually recommend mixpanel, their api is easy to integrate with xano

Hi Samuel,

Many thanks for the answer. So if I understand correctly : you create a post api endpoint which you execute from Weweb workflow when the user logs in?

Thanks

You don’t need to do anything on Weweb side, as info like the user_agent, IP etc. will already be in the “request headers”.

In Xano you have access to the $http_headers, as you know.
You can also access the IP address directly from the header just by using “$remote_ip”

Then the last step in Xano - Add the utility function “IP Address lookup" - gets the geolocation of an IP address. No third-party service needed.