--- title: Using Automatic Relevance Tuning (ART) in Coveo for Commerce slug: o3m90077 canonical_url: https://docs.coveo.com/en/o3m90077/ collection: coveo-for-commerce source_format: adoc --- # Using Automatic Relevance Tuning (ART) in Coveo for Commerce In the context of Coveo for Commerce, [Coveo Machine Learning (Coveo ML)](https://docs.coveo.com/en/188/) [Automatic Relevance Tuning (ART)](https://docs.coveo.com/en/1013/) [models](https://docs.coveo.com/en/1012/) improve the ranking of products presented in search results and on listing pages. In more detail, ART uses machine learning to predict the relevance of each product for a given query and user context, and then adjusts the ranking of products accordingly. It learns primarily from search and click [events](https://docs.coveo.com/en/260/). When you're using an ART model in a Coveo for Commerce implementation, it also learns from commerce-specific user actions such as [cart](https://docs.coveo.com/en/o1n93466/) and [purchase](https://docs.coveo.com/en/o1n93059/) events. However, even in a Coveo for Commerce implementation, ART models can't learn from commerce events alone. When configuring ART in a Coveo for Commerce scenario, the models must undergo a specific configuration at both the [model creation](#model-creation) and [model association](#model-association) levels. For more information on ART models outside of the Coveo for Commerce context, see [About Automatic Relevance Tuning (ART)](https://docs.coveo.com/en/3384/). ## Model creation When you [create an ART model](https://docs.coveo.com/en/3397/) for Coveo for Commerce, it requires a specific configuration. More specifically, you must: * Create separate ART models for search and product listings. An ART model shouldn't be used to power both search and product listings. Using separate ART models in search and listings provides more granular control and ensures that future modifications won't require changes to the initial setup. * [Enable the **Include commerce events** option](#enable-the-include-commerce-events-option). * If your [Coveo organization](https://docs.coveo.com/en/185/) powers multiple [tracking IDs](https://docs.coveo.com/en/o25a0034#tracking-id), you must [configure learning filters](#configure-learning-filters). ### Enable the "Include commerce events" option When [creating an ART model](https://docs.coveo.com/en/3397/) for Coveo for Commerce, you must enable the **Include commerce events** option. This lets the model learn from commerce-specific user actions like [cart](https://docs.coveo.com/en/o1n93466/) and [purchase](https://docs.coveo.com/en/o1n93059/) events, in addition to search and click events. > **Note** > > ART models can't learn from commerce events alone. > Cart and purchase events can only help reinforce popularity trends and boost product rankings. > ART models always require search and click events. ![Include commerce events option in ART model creation](https://docs.coveo.com/en/assets/images/coveo-for-commerce/images/art-commerce-events.png) ### Configure learning filters When using ART [models](https://docs.coveo.com/en/1012/) for a Coveo for Commerce [organization](https://docs.coveo.com/en/185/), you must configure learning filters to ensure that the model only uses the data that's relevant to the website on which it's deployed. To configure learning filters: . Once you've created your model, access the [**Models**](https://platform.cloud.coveo.com/admin/#/orgid/ai-and-ml/models/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/ai-and-ml/models/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/ai-and-ml/models/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/ai-and-ml/models/)) page. . Click the desired model, and then click **More** > **Edit JSON** in the Action bar. . In **Edit a Model JSON Configuration**, add the following `commonFilter` object: ```json "commonFilter": "(trackingId=@'')" ``` Where you replace `` with the [tracking ID](https://docs.coveo.com/en/o8rb0139/) (registered as properties in your Coveo organization) defined for the website on which you want to use the model. . Click **Save**. **Example** If you have a model that you want to use on a website for which the registered [tracking ID](https://docs.coveo.com/en/o8rb0139/) is `barca_sports_us`, your JSON configuration should look like this: ```json { "modelDisplayName": "Barca Sports US - ART", "exportPeriod": "P3M", "intervalTime": 1, "intervalUnit": "WEEK", "commonFilter": "(trackingId=@'barca_sports_us')", "exportOffset": "PT0S", "extraConfig": { "commerceSupport": { "enabled": true } } } ``` ## Model association When associating an ART model with a [query pipeline](https://docs.coveo.com/en/180/) that serves either a [listing](#listing-page) or [search](#search-page) page, the association requires a specific configuration. ### Listing page When [associating an ART model](https://docs.coveo.com/en/l1ca1038/) with a query pipeline that serves listing pages, ensure that you configure the following: . In the **Advanced configuration** section, select the **Match the advanced query** checkbox. ![Enable Match the advanced query option](https://docs.coveo.com/en/assets/images/coveo-for-commerce/images/match-advanced-query-option.png) . Once the association is done, [edit the association's JSON configuration](https://docs.coveo.com/en/l1ca1038#edit-an-art-model-association-via-a-json-configuration) to set the recommended [`rankingModifier`](https://docs.coveo.com/en/l1ca1038#rankingmodifier-integer-int32) and [`maxRecommendations`](https://docs.coveo.com/en/l1ca1038#maxrecommendations-integer-int32) values: ** `rankingModifier`: `500` ** `maxRecommendations`: `50` ```JSON [...] "rankingModifier": 500, "maxRecommendations": 50, [...] ``` ### Search page When [associating an ART model](https://docs.coveo.com/en/l1ca1038/) with a query pipeline that serves search pages, in the **Advanced configuration** section, ensure that both the **Match the advanced query** and **Match the query** checkboxes are selected. ![Enable Match the query and Match the advanced query options](https://docs.coveo.com/en/assets/images/coveo-for-commerce/images/match-query-match-advanced-query.png)