Product recommendation prediction (preview) sample guide
[This article is prerelease documentation and is subject to change.]
This guide walks you through an end-to-end example of product recommendation prediction using sample data. We recommend that you try this prediction in a new environment.
Important
- This is a preview feature.
- Preview features aren't meant for production use and may have restricted functionality. These features are available before an official release so that customers can get early access and provide feedback.
Scenario
Contoso is a company that produces high-quality coffee and coffee machines. They sell the products 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 Dynamics 365 Customer Insights - Data.
Task 1 - Ingest data
Review the articles about data ingestion and connecting to a Power Query data source. The following information assumes you are familiar with ingesting data in general.
Ingest customer data from eCommerce platform
Create a Power query data source named eCommerce 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 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 to eCommercePurchases.
Save the data source.
Ingest customer data from loyalty schema
Create a data source named LoyaltyScheme and select the Text/CSV connector.
Enter the URL for loyal customers 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 to loyCustomers.
Save the data source.
Task 2 - Data unification
Review the article about data unification. The following information assumes you are familiar with data unification in general.
After ingesting the data, begin the data unification process to create a unified customer profile. For more information, see Data unification.
Describe the customer data to be unified
After ingesting the data, map contacts from eCommerce and Loyalty data to common data types. Go to Data > Unify.
Select the tables 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.
Define matching rules
Choose eCommerceContacts : eCommerce as the primary table 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.
Add a second condition for email address:
- Select Email for both eCommerceContacts and loyCustomers.
- Leave Normalize blank.
- Set Precision Level: Basic and Value: High.
- Enter FullName, Email for the name.
Select Done.
Select Next.
View unified data
Rename the ContactId for loyCustomers table to ContactIdLOYALTY to differentiate it from the other IDs ingested.
Select Next to review and then select Create customer profiles.
Task 3 - Create transaction history activity
Review the article about customer activities. The following information assumes you are familiar with creating activities in general.
Create an activity with the eCommercePurchases:eCommerce table.
Select SalesOrderLine for the Activity Type and PurchaseId for the Primary key.
Enter the following information for the activity:
- Activity name: eCommercePurchases
- TimeStamp: PurchasedOn
- EventActivity: TotalPrice
- Order line ID: PurchaseId
- Order date: PurchasedOn
- Amount: TotalPrice
Create a relationship between eCommercePurchases:eCommerce and eCommerceContacts:eCommerce with ContactID as the foreign key to connect the two tables.
Review your changes and then select Create activities.
Task 4 - Configure product recommendation prediction
With the unified customer profiles in place and activity created, run the product recommendation prediction.
Go to Insights > Predictions.
On the Create tab, select Use model on the Product recommendations (preview) tile.
Select Get started.
Name the model OOB Product Recommendation Model Prediction and the output table OOBProductRecommendationModelPrediction.
Select Next.
Define model preferences:
- Number of products: 5 to define how many products you want to recommend to your customers.
- Repeat purchases expected: Yes to include previously purchased products in the recommendation.
- Look back window: 365 days to define how far the model will look back before recommending a product again.
Select Next.
In the Add purchase history step, select Add data.
Select SalesOrderLine and the eCommercePurchases table and select Next. The required data is automatically filled in from the activity. Select Save and then Next.
Skip the Add product information and Product filters steps because we don't have product information data.
In the Data updates step, select Monthly for the model schedule.
Select Next.
After reviewing all the details, select Save and Run.
Task 5 - Review model results and explanations
Let the model complete the training and scoring of the data. Review the product recommendation model explanations.
Task 6 - Create a segment of high purchased products
Running the model creates a new table, which is listed on Data > Tables. You can create a new segment based on the table created by the model.
On the results page, select Create segment.
Create a rule using the OOBProductRecommendationModelPrediction table and define the segment:
- Field: ProductID
- Value: Select the top three product IDs
Select Save and Run the segment.
You now have a segment that is dynamically updated which identifies the customers who might be interested in purchasing the five most recommended products. For more information, see Create and manage segments.
Tip
You can also create a segment for a prediction model from the Insights > Segments page by selecting New and choosing Create from > Insights. For more information, see Create a new segment with quick segments.