Once the ML model is ready, you must create a serving configuration for each unique place where you want to provide your shoppers with product recommendations.
Serving configurations are how you define which ML model you want to use when requesting product recommendations. The process starts by creating your serving configuration in the GCP console, which includes information on which model you want to use and a few other settings.
Then, when you request product recommendations, you will specify the serving configuration ID, which is how you define which model you want to use when requesting product recommendations.
We recommend a unique serving configuration for each placement + ML model type. A “placement” is where you will provide your shoppers’s recommendations on your website.
By using serving configurations, you can save on model training costs. For example, you may want to showcase a “Recommended for you” recommendation on your home and product detail pages. Rather than creating two different ML models for each placement, you can create a single ML model for “Recommended for you” and then create two different serving configurations for each placement. The model will be able to understand that there are two placements using the serving configurations and adjust its recommendations based on each unique placement.
After you have the serving configuration(s) set up, you will make a request to the GraphQL Storefront API each time you render a page. The API returns a recommendation specific to the shopper at that moment in time in the response body.
Here are the flow of events:
Technical Design Considerations:
You can narrow your prediction results by specifying filter criteria in your GraphQL Storefront API requests. BigCommerce passes the criteria to Google Vertex AI to use Google’s filtered recommendations. Google Vertex AI will then handle the filtering when responding with the list of recommended products. The options for filtering are based on the catalog data sent to Google.
By default, products marked as “not visible” on your BigCommerce catalog’s storefront will not appear in product recommendations. This is achieved by three pieces working together:
If you want to filter on other product attributes when getting product recommendations, you will need to make sure the following settings are set up correctly:
Retrieving recommendations through BigCommerce’s GraphQL Storefront API has the following benefits:
You can incorporate product recommendations anywhere on your website where you have the ability to modify your theme to utilize the GQL Storefront API.
The following example requests product recommendations from BigCommerce. For information on authentication, see the Authenticating Requests to the GraphQL Storefront API article. To see how to modify your Stencil theme, see the reference code for Cornerstone.
You can test the model with arbitrary data without affecting live data or impacting the model’s performance. To do so, use the validateOnly flag, as shown in the following example.
If a store has cookie tracking consent enabled, the shopper must provide consent to advertising for you to use Google Vertex AI. This consent ensures that BigCommerce complies with user consent preferences. For more information, see the Set cookie consent preferences endpoint.
If a store has cookie tracking consent enabled and a shopper doesn’t provide consent, you’ll receive an error message when requesting product recommendations for that shopper: