Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement geolocation #242

Open
eliasyishak opened this issue Feb 28, 2024 · 3 comments
Open

Implement geolocation #242

eliasyishak opened this issue Feb 28, 2024 · 3 comments

Comments

@eliasyishak
Copy link
Contributor

GA4 does not behave like GA3, we should have a mechanism for resolving geolocation data within the package if GA4 is unable to support this feature

@eliasyishak
Copy link
Contributor Author

http://ip-api.com/json seems to be a promising but we may not be permitted to use it... from the home page, "Free for non-commercial use"

@eliasyishak
Copy link
Contributor Author

https://ipregistry.co/ another alternative but this has a cost... and with us having this package be open-source, we would have to expose our API key publicly.. likely not a good option

@eliasyishak
Copy link
Contributor Author

eliasyishak commented Mar 5, 2024

https://freeipapi.com/ this alternative seems to be free and doesn't require an API key. Website also says it is permitted for commercial use

Simply running curl https://freeipapi.com/api/json/8.8.8.8 returns json for that IP endpoint

{
    "ipVersion": 4,
    "ipAddress": "8.8.8.8",
    "latitude": 37.386051,
    "longitude": -122.083847,
    "countryName": "United States of America",
    "countryCode": "US",
    "timeZone": "-08:00",
    "zipCode": "94035",
    "cityName": "Mountain View",
    "regionName": "California",
    "isProxy": false,
    "continent": "Americas",
    "continentCode": "AM"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant