--- title: Setup guide slug: o25a0034 canonical_url: https://docs.coveo.com/en/o25a0034/ collection: coveo-for-commerce source_format: adoc --- # Setup guide To properly leverage Coveo for Commerce capabilities, it's essential that your [Coveo organization](https://docs.coveo.com/en/185/) is optimally configured to integrate with the Commerce API. This setup also enables you to manage Coveo-powered search, [product listing pages (PLPs)](https://docs.coveo.com/en/m1sf3187/), and [recommendation slots](https://docs.coveo.com/en/o9b80563/) through the [Coveo Merchandising Hub (CMH)](https://docs.coveo.com/en/o5290573/). This guide provides an overview of the Coveo for Commerce implementation process. It contains collapsible sections that you can expand to learn more about each aspect of the implementation. It also includes links to additional articles with detailed instructions on how to complete specific tasks. This guide covers the following topics: * [Mapping your storefront architecture to Coveo](#map-your-storefront-architecture-to-coveo) * [Indexing your catalog data](#index-your-catalog-data) * [Defining storefront associations](#define-storefront-associations) * [Configuring Coveo Machine Learning models](#machine-learning-models-for-coveo-for-commerce) * [Building commerce interfaces](#build-commerce-interfaces) * [Logging commerce events](#log-commerce-events) ## Map your storefront architecture to Coveo To effectively [index](https://docs.coveo.com/en/204/) your product inventory, track commerce events, use the Commerce API, and manage product discovery through the [Coveo Merchandising Hub (CMH)](https://docs.coveo.com/en/o5290573/), you must map your [storefronts](https://docs.coveo.com/en/p33g0410/) in a way that's compatible with Coveo. In Coveo for Commerce, [storefronts](https://docs.coveo.com/en/p33g0410/) are organized into [properties](https://docs.coveo.com/en/p4ue0547/), each of which can support multiple [locales](https://docs.coveo.com/en/p4tf0351/). For example, if you have two storefronts—one in Canada and one in the United States—your [organization](https://docs.coveo.com/en/185/) would include two [properties](https://docs.coveo.com/en/p4ue0547/), one for each [storefront](https://docs.coveo.com/en/p33g0410/). Each [property](https://docs.coveo.com/en/p4ue0547/) can have multiple [locales](https://docs.coveo.com/en/p4tf0351/). For example, if your Canadian [storefront](https://docs.coveo.com/en/p33g0410/) supports both English and French, you would have two [locales](https://docs.coveo.com/en/p4tf0351/) under the Canadian [property](https://docs.coveo.com/en/p4ue0547/). Each [storefront](https://docs.coveo.com/en/p33g0410/)/[locale](https://docs.coveo.com/en/p4tf0351/) combination would have its own [Catalog source](https://docs.coveo.com/en/l5if0244/) and [catalog entity](https://docs.coveo.com/en/3143/) representing the products available for that specific combination. The following diagram shows how the Barca brand's [storefront](https://docs.coveo.com/en/p33g0410/) architecture could be set up in Coveo for Commerce, considering the following variations: * Two [storefronts](https://docs.coveo.com/en/p33g0410/): **Canada storefront** and **US storefront** * Two supported currencies: `CAD` and `USD` * Supported languages for each [storefront](https://docs.coveo.com/en/p33g0410/): ** **Canada storefront**: English and French ** **US storefront**: English and Spanish ![Diagram showing the declination of storefront setup to Coveo's standards | Coveo for Commerce](https://docs.coveo.com/en/assets/images/coveo-for-commerce/images/storefront-setup.png) Expand the following sections to learn more about the different concepts that you must consider when mapping your [storefront](https://docs.coveo.com/en/p33g0410/) architecture to Coveo. Note that you won't implement these concepts right away, but you should be aware of them to ensure that your [storefronts](https://docs.coveo.com/en/p33g0410/) are set up correctly in Coveo. **Tracking ID**
Details [discrete] ### Tracking ID [tracking IDs](https://docs.coveo.com/en/o8rb0139/) are unique identifiers that identify specific storefronts in [Coveo Analytics events](https://docs.coveo.com/en/260/). All of your storefronts must have their own tracking ID. While tracking ID values are specified when sending [events](https://docs.coveo.com/en/260/), each value that's sent must be registered using a **Property** in your organization. See [Properties](#properties) for more information. In the context of the [Coveo Merchandising Hub (CMH)](https://docs.coveo.com/en/o5290573/), the management of the product discovery solutions is segmented by tracking ID. This means that merchandising actions, such as boosting products or creating rules, are specific to each tracking ID. See [What's a tracking ID?](https://docs.coveo.com/en/n8tg0567/) for more information about tracking IDs.
**Properties**
Details [discrete] ### Properties [Coveo Analytics](https://docs.coveo.com/en/182/) [properties](https://docs.coveo.com/en/p4ue0547/) are [tracking IDs](https://docs.coveo.com/en/o8rb0139/) managed within a [Coveo organization](https://docs.coveo.com/en/185/). Each [property](https://docs.coveo.com/en/p4ue0547/) consists of a user-readable display name, enabling simplified management and analysis of data across various sites or applications. [properties](https://docs.coveo.com/en/p4ue0547/) help you better organize and interpret usage data for specific contexts. Each of your [storefronts](https://docs.coveo.com/en/p33g0410/) must have its own [property](https://docs.coveo.com/en/p4ue0547/) so you can manage the [tracking ID](https://docs.coveo.com/en/o8rb0139/) associated with it. More precisely, you must use [properties](https://docs.coveo.com/en/p4ue0547/) to: * Register new and existing [tracking IDs](https://docs.coveo.com/en/o8rb0139/). * Create relevant display names for [tracking IDs](https://docs.coveo.com/en/o8rb0139/). This is useful when you have multiple [tracking IDs](https://docs.coveo.com/en/o8rb0139/) and you want to easily identify them when analyzing data. * Deregister and delete [tracking IDs](https://docs.coveo.com/en/o8rb0139/). Although [tracking ID](https://docs.coveo.com/en/o8rb0139/) values are specified when sending [Coveo Analytics events](https://docs.coveo.com/en/260/), [properties](https://docs.coveo.com/en/p4ue0547/) are managed through the [**Properties**](https://platform.cloud.coveo.com/admin/#/orgid/usage/properties/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/usage/properties/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/usage/properties/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/usage/properties/)) page of the [Coveo Administration Console](https://docs.coveo.com/en/183/). Every [tracking ID](https://docs.coveo.com/en/o8rb0139/) in your [events](https://docs.coveo.com/en/260/) must be registered as a [property](https://docs.coveo.com/en/p4ue0547/) in your [Coveo organization](https://docs.coveo.com/en/185/) to allow for proper data tracking and interpretation. [example] **Example**
Your [Coveo organization](https://docs.coveo.com/en/185/) powers two brands that each have their own [storefronts](https://docs.coveo.com/en/p33g0410/): **Barca sports US** and **Barca sports Canada**. [Coveo Analytics events](https://docs.coveo.com/en/260/) that are logged from these [storefronts](https://docs.coveo.com/en/p33g0410/) are sent with the following [tracking IDs](https://docs.coveo.com/en/o8rb0139/): * `barca_sports_us` * `barca_sports_ca` To allow for accurate data tracking and analysis, you create two [properties](https://docs.coveo.com/en/p4ue0547/) to register these [tracking IDs](https://docs.coveo.com/en/o8rb0139/): * **Barca Sports US** * **Barca Sports CA** ##### == Default property All [Coveo organizations](https://docs.coveo.com/en/185/) include a built-in default [property](https://docs.coveo.com/en/p4ue0547/). The default [property](https://docs.coveo.com/en/p4ue0547/) functions like any other [property](https://docs.coveo.com/en/p4ue0547/) but is designated as a fallback for events that don't have a specified [tracking ID](https://docs.coveo.com/en/o8rb0139/). This includes events sent with a null [tracking ID](https://docs.coveo.com/en/o8rb0139/) and those with an invalid [tracking ID](https://docs.coveo.com/en/o8rb0139/). Organizations may use a null [tracking ID](https://docs.coveo.com/en/o8rb0139/) for various purposes, such as logging internal events or scenarios where a specific [tracking ID](https://docs.coveo.com/en/o8rb0139/) isn't needed. A null [tracking ID](https://docs.coveo.com/en/o8rb0139/) is valid and doesn't indicate an error. When an event is sent with a null [tracking ID](https://docs.coveo.com/en/o8rb0139/), it's categorized under the default [property](https://docs.coveo.com/en/p4ue0547/), and its [tracking ID](https://docs.coveo.com/en/o8rb0139/) field remains null in the event data. In the [Event browser](https://docs.coveo.com/en/n3re0108/): * Events with a null [tracking ID](https://docs.coveo.com/en/o8rb0139/) appear under the default [property](https://docs.coveo.com/en/p4ue0547/). * Events with an invalid [tracking ID](https://docs.coveo.com/en/o8rb0139/) retain their original [tracking ID](https://docs.coveo.com/en/o8rb0139/) in the event data, but are categorized under the default [property](https://docs.coveo.com/en/p4ue0547/) and marked as `Invalid`. This ensures that all [events](https://docs.coveo.com/en/260/) are properly tracked and categorized, regardless of whether their [tracking ID](https://docs.coveo.com/en/o8rb0139/) is missing, invalid, or deliberately left null. For more information on how to manage [properties](https://docs.coveo.com/en/p4ue0547/), see [Properties](https://docs.coveo.com/en/o7vh0012/). #### .Locale
Details [discrete] ### Locale A given [storefront](https://docs.coveo.com/en/p33g0410/) can support many languages, countries, or currencies, resulting in variations in product attributes like names, descriptions, and prices. The [Coveo Platform](https://docs.coveo.com/en/186/) addresses this complexity by using [locales](https://docs.coveo.com/en/p4tf0351/) to distinguish unique combinations of language, country, and currency. [locales](https://docs.coveo.com/en/p4tf0351/) allow for reporting according to the language, country, and currency of the user's experience. You can also use them to manage [product discovery solutions](https://docs.coveo.com/en/o9cf0524/) for each language, country, and currency permutation within the [Coveo Merchandising Hub (CMH)](https://docs.coveo.com/en/o5290573/). [NOTE] **Notes**
* A [storefront](https://docs.coveo.com/en/p33g0410/) can have multiple [locales](https://docs.coveo.com/en/p4tf0351/) associated with it. * [locales](https://docs.coveo.com/en/p4tf0351/) are [storefront](https://docs.coveo.com/en/p33g0410/) parameters, not [visitor](https://docs.coveo.com/en/nbub9475/) browser parameters. For example, if a [visitor](https://docs.coveo.com/en/nbub9475/)’s browser default language is set to German, and they're browsing an English site, the [locale](https://docs.coveo.com/en/p4tf0351/) language is `en`. Similarly, a visitor located in Germany browsing a US-based [storefront](https://docs.coveo.com/en/p33g0410/) that sells products in American dollars would have their [locale](https://docs.coveo.com/en/p4tf0351/) tracked with the country set to `US` and the currency set to `USD`, even though they're physically located in a country that uses a different currency. ##### [locales](https://docs.coveo.com/en/p4tf0351/) are defined for every potential combination of supported language, country, and currency that your [storefronts](https://docs.coveo.com/en/p33g0410/) support. **Example** Your organization powers two brands: **Barca sports** and **Barca parts**. You operate in two different countries: **United States** and **Canada**. In the United States, you only support English, and in Canada, you support both English and French. Therefore, you have three different [locales](https://docs.coveo.com/en/p4tf0351/): * `en-US-USD` * `en-CA-CAD` * `fr-CA-CAD` #### == Index your catalog data To make your product inventory available in the Coveo ecosystem, add your product content to the Coveo [index](https://docs.coveo.com/en/204/). Typically, this content is stored in repositories such as product information management systems (PIMs) and digital asset management systems (DAMs) in your own ecosystem. To ensure a successful Coveo for Commerce implementation, it's necessary to aggregate and format this content in a way that can be read and understood by Coveo. Bringing your product inventory to the Coveo ecosystem and maintaining it involves the following steps: * Creation of index sources. * Configuration and mapping of commerce fields. * Pushing your content to the sources using the Stream API. * Creation of a [catalog entity](https://docs.coveo.com/en/3143/). * Updating the content using the different update operations offered by the Stream API. The articles in the [Index and manage catalog data](https://docs.coveo.com/en/3448/) collection cover each step in detail, but this section provides a high-level overview of what's required to get your product inventory into Coveo and maintain it. > **Tip** > > The [resource snapshots](https://docs.coveo.com/en/3239/) feature lets you copy configurations from one Coveo for Commerce [organization](https://docs.coveo.com/en/185/) to another, such as when you migrate from a sandbox to a production organization. > It only copies the source configuration, not the source content. > > Use this feature to reuse your [catalog entities](https://docs.coveo.com/en/3143/) and their [catalog configurations](https://docs.coveo.com/en/l5if0520/), your [Catalog sources](https://docs.coveo.com/en/l5if0244/), and your [fields](https://docs.coveo.com/en/200/) and field [mappings](https://docs.coveo.com/en/217/). Expand the following sections to learn more about the different steps required to index and maintain your product inventory in Coveo for Commerce: **Index sources**
Details [discrete] ### Index sources You'll typically use a [Catalog source](https://docs.coveo.com/en/l5if0244/) to [index](https://docs.coveo.com/en/204/) your product inventory into the Coveo ecosystem. Create separate product [sources](https://docs.coveo.com/en/246/) for each [locale](https://docs.coveo.com/en/p4tf0351/) you support,[.footnote]^[[{counter:footnote-number-counter}](#language-footnote1)]^ so [Coveo ML](https://docs.coveo.com/en/188/) [models](https://docs.coveo.com/en/1012/) can learn independently from each experience. This results in recommendations that are optimally personalized to users' preferences and search behavior on each website in your multi-catalog structure. [example] **Example**
The company **Barca** sells products in Canada and the US. In Canada, they support French and English. In the US, they support English and Spanish. They have the following [storefronts](https://docs.coveo.com/en/p33g0410/): * Barca Canada (`www.sports.barca.group/ca/`). This storefront supports French (`www.sports.barca.group/ca/fr/`) and English (`www.sports.barca.group/ca/en/`). * Barca US (`www.sports.barca.group/us/`). This storefront supports English (`www.sports.barca.group/us/en/`) and Spanish (`www.sports.barca.group/us/es/`). This setup requires the creation of four product sources: * One for the English variation of the Canadian storefront. * One for the French variation of the Canadian storefront. * One for the English variation of the US storefront. * One for the Spanish variation of the US storefront. ##### > **Note** > > Some setups require an additional source to index items of the [availability](https://docs.coveo.com/en/mc7e9096/) catalog object. > See [Source configuration approaches for availability channel](https://docs.coveo.com/en/nbga0384/) for details. -- {counter:footnote-number-counter}. Having a separate source for each [locale](https://docs.coveo.com/en/p4tf0351/) you're supporting will likely lead to content duplication. This could affect your [product entitlements](https://docs.coveo.com/en/l2590456#commerce-solutions). -- For instructions on how to create Catalog sources, see [Add a Catalog source](https://docs.coveo.com/en/n8of0593/). #### .Configure and map commerce fields
Details [discrete] ### Configure and map commerce fields It's essential to configure and map your commerce fields to ensure that your product inventory is properly indexed and that the Coveo Machine Learning models can learn from your data. These fields contain [metadata](https://docs.coveo.com/en/218/), such as the product name or price. Fields are also used as attributes to build rules in the [Coveo Merchandising Hub (CMH)](https://docs.coveo.com/en/o5290573/). If you want to use a given field as an attribute in rules, you must enable the [**Facet** or **Multi-value facet** option](https://docs.coveo.com/en/1833#facet-and-multi-value-facet) for that field. To learn how to configure and map commerce fields, see [Commerce fields](https://docs.coveo.com/en/n73f0502/).
**Pushing content**
Details [discrete] ### Upload content To add content to your Catalog sources, you'll have to use the Stream API. For instructions on how to use the Stream API, see [Push and update your catalog data](https://docs.coveo.com/en/p48b0322/).
**Catalog entities**
Details [discrete] ### Catalog entities The [catalog entity](https://docs.coveo.com/en/3143/) is at the core of a Coveo for Commerce implementation. It establishes relationships between the [catalog objects](https://docs.coveo.com/en/ncig0154/). A catalog entity also lets you standardize your commerce fields to ensure data reliability for [Coveo Machine Learning (Coveo ML)](https://docs.coveo.com/en/188/) [models](https://docs.coveo.com/en/1012/). There's a 1-to-1 relationship between product sources and [catalog entities](https://docs.coveo.com/en/3143/). For each source you create that contains products, you must also create a catalog entity. However, sources that only contain items of the `availability` object type can be shared across multiple catalog entities. For instructions on how to manage catalog entities, see [Commerce catalog entity](https://docs.coveo.com/en/3139/).
**Update content**
Details [discrete] ### Update content [Catalog source](https://docs.coveo.com/en/l5if0244/) updates are required when you must add, remove, or update [items](https://docs.coveo.com/en/pa8f6515/) in your [source](https://docs.coveo.com/en/246/). Coveo offers three update operations to maintain your sources up-to-date with your own product ecosystem: * [Full item updates](https://docs.coveo.com/en/p4eb0129#update-operations): Update all [fields](https://docs.coveo.com/en/200/) in a given item, or add and delete items. * [Partial item updates](https://docs.coveo.com/en/p4eb0515#partial-item-updates): Update one or more fields in an existing source. * [Shallow merge operation](https://docs.coveo.com/en/p4eb0515#shallow-merge-operations): Update one or more fields in an item. If the item doesn't exist, it will be created, and if the field is missing, it will be added.
## Define storefront associations There's a 1:1 relationship between [Catalog sources](https://docs.coveo.com/en/l5if0244/) and [catalog entities](https://docs.coveo.com/en/3143/). This means that you should have one [Catalog source](https://docs.coveo.com/en/l5if0244/) and a matching [catalog entity](https://docs.coveo.com/en/3143/) for each language, country, currency, and brand you're selling your products in. A single [tracking ID](https://docs.coveo.com/en/o8rb0139/) can apply to multiple [locale](https://docs.coveo.com/en/p4tf0351/) combinations. For example, if you have a [tracking ID](https://docs.coveo.com/en/o8rb0139/) identifying a [storefront](https://docs.coveo.com/en/p33g0410/) for a brand that sells products in both English and French in Canada, you would have a single [tracking ID](https://docs.coveo.com/en/o8rb0139/) associated with two [locales](https://docs.coveo.com/en/p4tf0351/): `en-CA-CAD` and `fr-CA-CAD`. [storefront](https://docs.coveo.com/en/p33g0410/) associations let you manage the relationship between [properties](https://docs.coveo.com/en/p4ue0547/), [locales](https://docs.coveo.com/en/p4tf0351/), and [catalog entities](https://docs.coveo.com/en/3143/). The [Coveo Platform](https://docs.coveo.com/en/186/) uses them to automatically infer the catalog ID targeted by a [property](https://docs.coveo.com/en/p4ue0547/) and [locale](https://docs.coveo.com/en/p4tf0351/) combination, so you don't need to specify the catalog ID when [authenticating commerce requests](https://docs.coveo.com/en/o8ld0051/). When you define a [storefront](https://docs.coveo.com/en/p33g0410/) association, the [Coveo Platform](https://docs.coveo.com/en/186/) will automatically create three [query pipelines](https://docs.coveo.com/en/180/) and their associated [conditions](https://docs.coveo.com/en/2793/), one for each [product discovery solution](https://docs.coveo.com/en/o9cf0524/). > **Note** > > If these [query pipelines](https://docs.coveo.com/en/180/) already exist for a given [tracking ID](https://docs.coveo.com/en/o8rb0139/), then the [Coveo Platform](https://docs.coveo.com/en/186/) won't create duplicates. > > For example, if your [storefront](https://docs.coveo.com/en/p33g0410/) consists of a single site with multiple language and currency options, you'll associate multiple [locales](https://docs.coveo.com/en/p4tf0351/) with a single [tracking ID](https://docs.coveo.com/en/o8rb0139/). > In this case, the [Coveo Platform](https://docs.coveo.com/en/186/) will only create these [query pipelines](https://docs.coveo.com/en/180/) for the first [storefront](https://docs.coveo.com/en/p33g0410/) association that you define with this [tracking ID](https://docs.coveo.com/en/o8rb0139/). For more information on [storefront](https://docs.coveo.com/en/p33g0410/) associations and these [query pipelines](https://docs.coveo.com/en/180/), see [Storefront associations](https://docs.coveo.com/en/o48e0216/). ### Query pipelines for Product listings For each [query pipeline](https://docs.coveo.com/en/180/) associated with the Product listings [solution](https://docs.coveo.com/en/o9cf0524/), you must [configure a ranking weight](https://docs.coveo.com/en/3412/) [query pipeline rule](https://docs.coveo.com/en/236/) to optimize the ranking of products on [product listing pages (PLPs)](https://docs.coveo.com/en/m1sf3187/). In this ranking rule, set all the ranking factors to `0`. ![Listings ranking rule in the Coveo Administration Console| Coveo](https://docs.coveo.com/en/assets/images/coveo-for-commerce/images/cmh/cmh-implementation-ranking-rule.png) ## Machine learning models for Coveo for Commerce Coveo recommends that you configure [Coveo Machine Learning (Coveo ML)](https://docs.coveo.com/en/188/) [models](https://docs.coveo.com/en/1012/) to power and enhance product discovery experiences. To increase personalization and relevancy, configure the recommended Coveo ML models for each of the product discovery solutions: [%header,cols="2*"] |=== |Product discovery solution |Recommended model .5+|Search |[Automatic Relevance Tuning (ART)](https://docs.coveo.com/en/1013/) (dedicated model optimized for search) |[Intent-Aware Product Ranking (IAPR)](https://docs.coveo.com/en/m61h0552/) (optional) |[Predictive Query Suggestions (PQS)](https://docs.coveo.com/en/m1ol5526/) or [Query Suggestions (QS)](https://docs.coveo.com/en/1015/) |[Dynamic Navigation Experience (DNE)](https://docs.coveo.com/en/2907/) |[Catalog Semantic Encoder (CSE)](https://docs.coveo.com/en/p9hg9124/) |Product listing |[Listing Page Optimizer (LPO)](https://docs.coveo.com/en/p72e0573/) .2+|Recommendations |[Product Recommendations (PR)](https://docs.coveo.com/en/3132/) |[Session-Based Product Recommendations (SBPR)](https://docs.coveo.com/en/m7db5404/) (required to power the **Intent-aware** [product recommendation strategy](https://docs.coveo.com/en/oaih0265#product-recommendation-strategies)) |=== **Configuring Coveo ML models**
Details [discrete] ### Configuring Coveo ML models To configure the Coveo ML models for product discovery solutions: . Configure the appropriate models for each product discovery solution. [TIP]
For optimal results, you should configure one model of each type for each of your [properties](https://docs.coveo.com/en/p4ue0547/). ##### -- ** [Automatic Relevance Tuning (ART)](https://docs.coveo.com/en/o3m90077/) ** [Intent-Aware Product Ranking (IAPR)](https://docs.coveo.com/en/m5vg6516/) ** [Predictive Query Suggestions (PQS)](https://docs.coveo.com/en/lcee0589/) ** [Query Suggestions (QS)](https://docs.coveo.com/en/p26b0268/) ** [Dynamic Navigation Experience (DNE)](https://docs.coveo.com/en/m2na0333/) ** [Catalog Semantic Encoder (CSE)](https://docs.coveo.com/en/p2jd0421/): You must contact your Coveo representative to enable CSE in your [Coveo organization](https://docs.coveo.com/en/185/). ** [Listing Page Optimizer (LPO)](https://docs.coveo.com/en/p2je0241/): You must contact your Coveo representative to enable LPO in your [Coveo organization](https://docs.coveo.com/en/185/). ** [Product Recommendations (PR)](https://docs.coveo.com/en/3382/) ** [Session-Based Product Recommendations (SBPR)](https://docs.coveo.com/en/m5rd0471/) -- **Example** You've defined the following [properties](https://docs.coveo.com/en/p4ue0547/) for your two Coveo-powered ecommerce sites or applications: * **Barca Sports US**, which registers the tracking ID `barca_sports_us` * **Barca Sports Canada**, which registers the tracking ID `barca_sports_ca` Therefore, you create the following [Coveo Machine Learning](https://docs.coveo.com/en/188/) [models](https://docs.coveo.com/en/1012/): [%header,cols="3*"] |=== |Property |Product discovery solution |Model name .7+|Barca Sports US (`barca_sports_us`) .5+|Search |Barca Sports US Search ART model |Barca Sports US Search IAPR model |Barca Sports US Search PQS model |Barca Sports US Search DNE model |Barca Sports US Search CSE model |Listing |Barca Sports US Listing LPO model |Recommendations |Barca Sports US Product Recommendations PR model .7+|Barca Sports Canada (`barca_sports_ca`) .5+|Search |Barca Sports CA Search ART model |Barca Sports CA Search IAPR model |Barca Sports CA Search PQS model |Barca Sports CA Search DNE model |Barca Sports CA Search CSE model |Listing |Barca Sports CA Listing LPO model |Recommendations |Barca Sports CA Product Recommendations PR model |=== . For ART, QS, DNE, and PR models, configure learning filters to ensure they only use data relevant to the website on which they're deployed. Refer to the articles listed in [step 1](#ml-step-1) for more information on how to configure learning filters for each model type. > **Note** > > For [IAPR](https://docs.coveo.com/en/m61h0552/) and [PQS](https://docs.coveo.com/en/m1ol5526/) models, instead of defining learning filters, you'll need to configure the model to use the appropriate [tracking IDs](https://docs.coveo.com/en/o8rb0139/) (registered as [properties](https://docs.coveo.com/en/p4ue0547/) in your Coveo organization). > > ![Configure the model to use the appropriate tracking ID](:https://docs.coveo.com/en/assets/images/coveo-for-commerce/images/pqs-iapr-tracking-id.png) . Associate the models with the [query pipelines](https://docs.coveo.com/en/180/) that are created when you [define your storefront associations](#define-storefront-associations). PR and SBPR models require a specific association configuration. See [Associate a PR model with a query pipeline](https://docs.coveo.com/en/p1vg0524/) for more information. #### .Migrating search ART, QS, and DNE models
Details [discrete] ### Migrating search ART, QS, and DNE models [NOTE] **Note**
This section is only relevant if you're migrating a Coveo for Commerce implementation that was targeting the Search API to the Commerce API. ##### If your Coveo for Commerce implementation previously used the Search API and you're now migrating to the Commerce API, you likely used [search hub](https://docs.coveo.com/en/1342/) values to distinguish between different websites. With the Commerce API, tracking IDs now serve this purpose instead. This transition from search hubs to tracking IDs causes existing models to stop using historical search hub data, meaning the models will rely only on events sent with the new tracking ID. This may lead to a short-term decrease in the model's performance as it learns from a new set of data. To maintain performance, you can update your ART, QS, and DNE models' JSON configuration so they continue using both historical search hub data and new tracking ID events. > **Important** > > * If the model you plan to migrate was used across multiple websites that don't return the same set of results, don't migrate the model. > Instead, create a new model of each type for each website and configure each model to use the tracking ID associated with its respective website. > > * Models that are used for the Listings product discovery solution can't be migrated. To update your ART, QS, and DNE models to use both the search hub value and the tracking ID: . In the [Coveo Administration Console](https://docs.coveo.com/en/183/), 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 ART, DNE, or QS model you want to update, and then in the Action bar, click **More** > **Edit JSON**. . In the JSON editor, update or add the `searchEventFilter` parameter to mention the search hub value previously used to identify the storefront, as well as the new tracking ID. Your JSON configuration should look like this: -- ```json { [...] "modelDisplayName": "MY_MODEL", "exportPeriod": "P3M", "intervalTime": 1, "intervalUnit": "WEEK", "exportOffset": "PT0S", "commonFilter": "", "searchEventFilter": "(originLevel1=~'' OR trackingId=~'')", "customEventFilter": "(originLevel1=~'' OR trackingId=~'')", [...] } ``` Where: * `` is the search hub value previously used to identify the storefront. * `` is the tracking ID value that now identifies the storefront. * The `customEventFilter` parameter is only required when migrating an ART model. **Example** Previously, you used `usa-sports-barca` as the search hub value to identify a storefront. After migrating to the Commerce API, the storefront is now identified by the tracking ID `barca_sports_us`. To update the model to use both search hub values, you update the model's JSON configuration as follows: ```json { [...] "modelDisplayName": "MY_MODEL", "exportPeriod": "P3M", "intervalTime": 1, "intervalUnit": "WEEK", "exportOffset": "PT0S", "commonFilter": "", "searchEventFilter": "(originLevel1=~'usa-sports-barca' OR trackingId=~'barca_sports_us')", "customEventFilter": "(originLevel1=~'usa-sports-barca' OR trackingId=~'barca_sports_us')", // If migrating an ART model [...] } ``` -- . Click **Save**. The model will retrain and start using both historical search hub data and new tracking ID events. > **Warning** > > Be aware of existing filter conditions and adapt the preceding example accordingly. > Also, be sure that any existing `originLevel1` logic is preserved and combined with the new `trackingId` logic. > > For example, if your starting point is: > > ```json { [...] "commonFilter": "(originLevel1=~'usa-sports-barca') AND (country=@'canada')", [...] } ``` > > You must adapt it to: > > ```json { [...] "commonFilter": "(country=@'canada')", "searchEventFilter": "((originLevel1=~'usa-sports-barca') OR (trackingId=~'barca_sports_us'))", [...] } ``` > **Leading practice** > > Once your model's data period has passed, you can remove the `originLevel1` references from the filters. > This is because, at that point, all the old, pre-migration data will have aged out, and the model will only be training on new events that have the `trackingId`. > You'll also be able to use the `trackingId` logic in the `commonFilter` parameter instead of the `searchEventFilter` and `customEventFilter` parameters. > > For example, if your model’s data period is three months (`"exportPeriod": "P3M"`), you can remove the `originLevel1` references three months after updating the model’s JSON configuration, and add the `trackingId` logic to the `commonFilter` parameter as follows: > > ```json { [...] "commonFilter": "(trackingId=~'barca_sports_us')", [...] } ``` #### == Build commerce interfaces Your [storefront](https://docs.coveo.com/en/p33g0410/) visitors use commerce interfaces to search, browse, and purchase products. Each of these interfaces is powered by a [product discovery solution](https://docs.coveo.com/en/o9cf0524/). Coveo for Commerce provides three distinct product discovery solutions: Search, Product listings, and Recommendations. It also offers a set of tools to simplify the implementation of your commerce interfaces. The articles of the [Build commerce interfaces](https://docs.coveo.com/en/o4ue6279/) collection cover each aspect of building commerce interfaces in detail, but this section provides a high-level overview of the different approaches you can take to build commerce interfaces in Coveo for Commerce. **Headless**
Details [discrete] ### Headless The [Coveo Headless library](https://docs.coveo.com/en/lcdf0493/) is a Redux-based toolset for developing your own UI component libraries. It provides the underlying functionality of the [Atomic library](https://docs.coveo.com/en/lcdf0264/) without tying that functionality to a specific UI implementation. We strongly recommend that you use the Headless library rather than work directly with the REST APIs, as Headless abstracts their complexity and provides a more developer-friendly interface. For more information, see [Headless for commerce](https://docs.coveo.com/en/o52e9091/).
**Atomic**
Details [discrete] ### Atomic [IMPORTANT]
Atomic for Commerce components are in open beta and remain under active development. Atomic for Commerce hasn't yet gone through a formal accessibility review. If you have accessibility needs, contact your customer success manager and we'll work with you to address them. ##### The [Coveo Atomic library](https://docs.coveo.com/en/lcdf0264/) is a collection of pre-built UI components meant to quickly create product discovery interfaces. You can theme and customize the Atomic components to suit your needs. Under the hood, Atomic relies on the [Coveo Headless](https://docs.coveo.com/en/lcdf0493/) library to interface with Coveo and handle the application state. For more information, see [Atomic for commerce](https://docs.coveo.com/en/p8bd0068/). #### .REST APIs
Details [discrete] ### REST APIs The Coveo Commerce REST APIs are a set of APIs that allow you to interact with the Coveo Platform. These APIs offer the most flexibility for interacting with the Coveo Platform, though they require more development effort and can be more challenging to use than Headless or Atomic. To implement your product discovery solution using the REST APIs, you need to send requests to the following APIs: * [Commerce API](https://docs.coveo.com/en/103/): This API allows you to query the Coveo Platform for products. * Event API: This API allows you to [log commerce events](https://docs.coveo.com/en/3188/) using the Event Protocol.
After you've chosen the right approach, you can start building your search, listing, and recommendation interfaces: * [Build commerce search pages](https://docs.coveo.com/en/o4ue0200/) * [Build commerce listing pages](https://docs.coveo.com/en/o4ue0471/) * [Build commerce recommendation slots](https://docs.coveo.com/en/o4ue0204/) ## Log commerce events It's crucial that you track [touchpoints](https://docs.coveo.com/en/o6ha0421/) to analyze [storefront](https://docs.coveo.com/en/p33g0410/) performance, create reports, and power [Coveo Machine Learning (Coveo ML)](https://docs.coveo.com/en/188/) [models](https://docs.coveo.com/en/1012/). You can do this by sending events to the [Coveo Analytics](https://docs.coveo.com/en/182/) service. > **Tip** > > Building commerce interfaces with Coveo UI libraries, such as [Coveo Atomic](https://docs.coveo.com/en/lcdf0264/) and [Coveo Headless](https://docs.coveo.com/en/lcdf0493/), considerably simplifies the implementation of usage analytics tracking. In Coveo for Commerce, you'll typically have to track the following user actions: * Product views * Product clicks * Cart events * Purchases It's through usage analytics tracking that [tracking IDs](https://docs.coveo.com/en/o8rb0139/) are defined to identify the different storefronts user actions are coming from. Once you're ready to track these actions, you must register the tracking IDs as [properties](https://docs.coveo.com/en/p4ue0547/) using the [**Properties**](https://platform.cloud.coveo.com/admin/#/orgid/usage/properties/) ([platform-ca](https://platform-ca.cloud.coveo.com/admin/#/orgid/usage/properties/) | [platform-eu](https://platform-eu.cloud.coveo.com/admin/#/orgid/usage/properties/) | [platform-au](https://platform-au.cloud.coveo.com/admin/#/orgid/usage/properties/)) page of the [Coveo Administration Console](https://docs.coveo.com/en/183/). For instructions on how to implement usage analytics tracking in Coveo for Commerce, see [Log commerce events](https://docs.coveo.com/en/3188/).