--- title: Location-based recommendations - Legacy slug: m8i90276 canonical_url: https://docs.coveo.com/en/m8i90276/ collection: coveo-for-commerce source_format: adoc --- # Location-based recommendations - Legacy > **Important** > > The content in this article is only relevant for Coveo for Commerce implementations that target the Search API to generate recommendations. > > Location-based recommendations aren't yet supported in Coveo for Commerce implementations that target the Commerce API. [Coveo Machine Learning (Coveo ML)](https://docs.coveo.com/en/188/) Product Recommendations [models](https://docs.coveo.com/en/1012/) learn from user behavior to automatically improve Coveo-powered content relevance (see [About Product Recommendations (PR)](https://docs.coveo.com/en/3382/)). You can take the relevance of Coveo ML PR models one step further by using customers' location as information to be used to personalize a model's output. **Example** You get the following information about your users location when they access your Coveo-powered commerce portal: * Country * Region * City Your home page contains a recommendation interface powered by a Coveo ML PR model that leverages the [Popular items (bought)](https://docs.coveo.com/en/p9pa3362#popular-items-bought) strategy. To personalize the recommendations and promote products adapted to each user's location, you set the users' `country`, `region`, and `city` to be consumed by Coveo ML. ## Leveraging location-based recommendations When a user performs actions on a Coveo-powered interface, Coveo gathers usage analytics (UA) [dimensions](https://docs.coveo.com/en/258/), which are passed along with the [Coveo Analytics](https://docs.coveo.com/en/182/) requests generated by the user's actions. Coveo automatically records users' location through their IP address. This information is kept in UA dimensions, such as [`city`](https://docs.coveo.com/en/2948#city), [`country`](https://docs.coveo.com/en/2948#country), and [`region`](https://docs.coveo.com/en/2948#region). This information is automatically consumed by Coveo ML PR models during the training phase. However, you must send this information to the [Search API](https://docs.coveo.com/en/52/) when [querying the model](https://docs.coveo.com/en/o4ue0204/) to ensure the model returns recommendations scoped on location. To do so, ensure that the captured user's location is sent through the [`context`](https://docs.coveo.com/en/13#operation/searchUsingPost-context) query parameter when querying the Coveo ML PR model. **Example** ```json "context": { "country":"Canada", "city":"Montreal", "region":"Quebec" } ```