Skip to content

API to return current user's geolocation "UserCountry.getLocationFromIP" #14496

@mattab

Description

@mattab

Goal of this issue is to make our existing API UserCountry.getLocationFromIP return the geolocation information for the requesting IP address by default.

Currently, the API requires an ip parameter. Example API request

But if we make it default to the current requester IP address then it will provide some great value and open new use cases. For example some users want to customise the website's content based on the user's geolocation. So they could simply call the API for example via: https://analytics.example.comorg/?module=API&method=UserCountry.getLocationFromIP&format=json in JavaScript.

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementFor new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions