Transactional churn prediction sample guide
This guide will walk you through an end to end example of Transactional Churn prediction in Customer Insights using the data provided below. All data used in this guide is not real customer data and is part of the Contoso dataset found in the Demo environment within your Customer Insights Subscription.
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 know which customers who typically purchase their products on a regular basis, will stop being active customers in the next 60 days. Knowing which of their customers is likely to churn, can help them save marketing efforts by focusing on keeping them.
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 right-hand 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 transaction churn prediction
With the unified customer profiles in place, we can now run the transaction churn prediction. For detailed steps, see the Transaction churn prediction article.
Go to Intelligence > Discover and select to use the Customer churn model.
Select the Transactional option and select Get started.
Name the model OOB eCommerce Transaction Churn Prediction and the output entity OOBeCommerceChurnPrediction.
Define two conditions for the churn model:
Prediction window: at least 60 days. This setting defines how far into the future do we want to predict customer churn.
Churn definition: at least 60 days. The duration without purchase after which a customer is considered churned.
Select Purchase History (required) and select Add data for purchase history.
Add the eCommercePurchases : eCommerce entity and map the fields from eCommerce to the corresponding fields required by the model.
Join the eCommercePurchases : eCommerce entity with eCommerceContacts : eCommerce.
Select Next to 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.
Task 4 - Review model results and explanations
Let the model complete the training and scoring of the data. You can now review the churn model explanations. For more information, see Review a prediction status and results.
Task 5 - Create a segment of high churn-risk customers
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 OOBeCommerceChurnPrediction endpoint and define the segment:
- Field: ChurnScore
- Operator: greater than
- Value: 0.6
You now have a segment that is dynamically updated which identifies high churn-risk customers.
For more information, see Create and manage segments.
Feedback
Submit and view feedback for