Product recommendation prediction sample guide
We'll walk you through an end to end example of product recommendation prediction using the sample data provided below.
Scenario
Contoso is a company that produces high-quality coffee and coffee machines, which they sell through their Contoso Coffee website. Their goal is to understand which products should they recommend to their recurring customers. Knowing what customers are more likely to purchase, can help them save marketing efforts by focusing on specific items.
Prerequisites
- At least Contributor permissions in Customer Insights.
- We recommend that you implement the following steps in a new environment.
Task 1 - Ingest data
Review the articles about data ingestion and importing data sources using Power Query connectors specifically. The following information assumes you familiarized with ingesting data in general.
Ingest customer data from eCommerce platform
Create a data source named eCommerce, choose the import option, and select the Text/CSV connector.
Enter the URL for eCommerce contacts: https://aka.ms/ciadclasscontacts.
While editing the data, select Transform and then Use First Row as Headers.
Update the datatype for the columns listed below:
- DateOfBirth: Date
- CreatedOn: Date/Time/Zone
In the 'Name' field on the right-hand pane, rename your data source from Query to eCommerceContacts
Save the data source.
Ingest online purchase data
Add another data set to the same eCommerce data source. Choose the Text/CSV connector again.
Enter the URL for Online Purchases data https://aka.ms/ciadclassonline.
While editing the data, select Transform and then Use First Row as Headers.
Update the datatype for the columns listed below:
- PurchasedOn: Date/Time
- TotalPrice: Currency
In the Name field on the side pane, rename your data source from Query to eCommercePurchases.
Save the data source.
Ingest customer data from loyalty schema
Create a data source named LoyaltyScheme, choose the import option, and select the Text/CSV connector.
Enter the URL for eCommerce contacts https://aka.ms/ciadclasscustomerloyalty.
While editing the data, select Transform and then Use First Row as Headers.
Update the datatype for the columns listed below:
- DateOfBirth: Date
- RewardsPoints: Whole Number
- CreatedOn: Date/Time
In the Name field on the right-hand pane, rename your data source from Query to loyCustomers.
Save the data source.
Task 2 - Data unification
After ingesting the data, begin the data unification process to create a unified customer profile. For more information, see Data unification.
Select source fields
After ingesting the data, map contacts from eCommerce and Loyalty data to common data types. Go to Data > Unify.
Select the entities that represent the customer profile – eCommerceContacts and loyCustomers.

Select ContactId as the primary key for eCommerceContacts and LoyaltyID as the primary key for loyCustomers.
Select Next. Skip duplicate records and select Next.
Match conditions
Choose eCommerceContacts : eCommerce as the primary entity and include all records.
Choose loyCustomers : LoyaltyScheme and include all records.
Add a rule:
- Select FullName for both eCommerceContacts and loyCustomers.
- Select Type (Phone, Name, Address, ...) for Normalize.
- Set Precision Level: Basic and Value: High.
- Enter FullName, Email for the name.
Add a second condition for email address:
- Select Email for both eCommerceContacts and loyCustomers.
- Leave Normalize blank.
- Set Precision Level: Basic and Value: High.

Select Done.
Select Next.
Unify fields
Rename the ContactId for loyCustomers entity to ContactIdLOYALTY to differentiate it from the other IDs ingested.
Select Next to review and then select Create customer profiles.
Task 3 - Configure product recommendation prediction
With the unified customer profiles in place, we can now run the product recommendation prediction.
Go to Intelligence > Prediction choose Product recommendation.
Select Get started.
Name the model OOB Product Recommendation Model Prediction and the output entity OOBProductRecommendationModelPrediction.
Define three conditions for the model:
Number of products: Set this value to 5. This setting defines how many products you want to recommend to your customers.
Repeat purchases expected: Select Yes to indicate that you want to include products in the recommendation that your customers have purchased before.
Look back window: Select at least 365 days. This setting defines how far the model will look back at the customer's activity to use it as input to their recommendations.
In the Add required data step, select Add data.
In the Add data pane, choose the SalesOrderLine as the purchase history entity. At this point, it's likely not yet configured. Open link in the pane to create the activity with the following steps:
- Enter an Activity name and choose eCommercePurchases:eCommerce as Activity entity. The Primary key is PurchaseId.
- Define and name the relationship to the eCommerceContacts:eCommerce entity and choose ContactId as the foreign key.
- For Activity unification, set Event activity as TotalPrice and Timestamp to PurchasedOn. You can specify more fields as outlined in Customer activities.
- For Activity type, choose SalesOrderLine. Map the following activity fields:
- Order line ID: PurchaseId
- Order ID: PurchaseId
- Order data: PurchasedOn
- Product ID: ProductId
- Amount: TotalPrice
- Review and finish the activity before going back to the model configuration.
Back in the Select activities step, choose the newly created activity in the Activities section. Select Next and the attribute mapping is already filled out. Select Save.
In this sample guide, we skip the Add product information and Product filters set because we don't have product information data.
In the Data updates step, set the model schedule.
The model needs to train regularly to learn new patterns when there is new data ingested. For this example, select Monthly.
After reviewing all the details, select Save and Run. It will take a few minutes to run the model the first time.
Task 4 - Review model results and explanations
Let the model complete the training and scoring of the data. You can now review the product recommendation model explanations. For more information, see Review a prediction status and results.
Task 5 - Create a segment of high purchased products
Running the production model creates a new entity that you can see in Data > Entities.
You can create a new segment based on the entity created by the model.
Go to Segments. Select New and choose Create from Intelligence.

Select the OOBProductRecommendationModelPrediction endpoint and define the segment:
- Field: ProductID
- Value: Select the top three product IDs
You now have a segment that is dynamically updated which identifies the customers who might be interested to purchase the three most recommended products.
For more information, see Create and manage segments.
Feedback
Submit and view feedback for