|
| 1 | +--- |
| 2 | +group: product-recommendations |
| 3 | +title: Integrate Product Recommendations into your Headless Storefront |
| 4 | +ee_only: True |
| 5 | +--- |
| 6 | + |
| 7 | +You can integrate Product Recommendations in a headless storefront using either [PWA Studio](https://magento.github.io/pwa-studio/) or a custom frontend technology, such as React or Vue JS. |
| 8 | + |
| 9 | +Product Recommendations require [behavioral and catalog data]({{ page.baseurl }}recommendations/product-recs.html#types-of-data) to operate. The catalog data sync process remains unchanged in a headless implementation, but changes are needed for behavioral data collection. |
| 10 | + |
| 11 | +To integrate Product Recommendations in a headless storefront you must: |
| 12 | + |
| 13 | +1. Send behavioral data to Adobe Sensei to analyze and compute Product Recommendation results. You also can send additional data to enable product recommendation [metrics reporting](https://docs.magento.com/user-guide/marketing/recommendation-metrics.html). |
| 14 | + |
| 15 | +1. Fetch product recommendation results and render those results on the page. |
| 16 | + |
| 17 | +You can perform both of these actions using the available SDKs as described below. |
| 18 | + |
| 19 | +The following workflow describes how to integrate Product Recommendation in a headless storefront. |
| 20 | + |
| 21 | +1. [Install the Product Recommendations]({{ page.baseurl }}/recommendations/install-configure.html) module. |
| 22 | + |
| 23 | +1. Install and use the [Storefront Events SDK]({{ page.baseurl }}/shared-services/storefront-events-sdk.html) to fire the [behavioral events]({{ page.baseurl }}/recommendations/events.html). |
| 24 | + |
| 25 | + The minimum required events to enable Product Recommendations are: |
| 26 | + |
| 27 | + Event | Category |
| 28 | + --- | --- |
| 29 | + `view` | product |
| 30 | + `add-to-cart` | product |
| 31 | + `place-order` | checkout |
| 32 | + |
| 33 | + To enable [metrics reporting](https://docs.magento.com/user-guide/marketing/recommendation-metrics.html), the following additional events are required: |
| 34 | + |
| 35 | + Event | Category |
| 36 | + --- | --- |
| 37 | + `impression-render` | recommendation-unit |
| 38 | + `view` | recommendation-unit |
| 39 | + `rec-click` | recommendation-unit |
| 40 | + `rec-add-to-cart-click` | recommendation-unit (if an add to cart button is present in the recommendations template) |
| 41 | + |
| 42 | +1. When the events are fired, use the [Storefront Events Collector]({{ page.baseurl }}/shared-services/storefront-event-collector.html) to handle the events and send them to Adobe Sensei. |
| 43 | + |
| 44 | +1. After the behavioral data is collected, you can [create Product Recommendations](https://docs.magento.com/user-guide/marketing/create-new-rec.html) in the Admin. |
| 45 | + |
| 46 | +1. Use the [Recommendations SDK]({{ page.baseurl }}/recommendations/recs-api.html) to fetch the recommendation units on the storefront. The SDK returns necessary product data to render recommendation units on a page. |
0 commit comments