Please follow the steps below to set up the Customer Insights (CI) environment
In this step you will create a Customer Insights environment, that you will use for this solution accelerator.
- Navigate to the Customer Insights workspace to create a new environment
- Note: if you have used Customer Insights before, you might not see steps 1.1-1.4
- Select Country/Region
- Select
Audiance insights
focus
- Select
Individual consumers (B-to-C)
business
- Provide a name for your workspace, select
Production
under "Type", select the region your Azure resources are deployed under "Region"
- In the Advance Settings, select
Azure Data Lake Storage Gen 2
under "Save output to" - Select
Azure subscription
under "Connect your storage account using" and click "Next"- choose your Subscription, Resource Group, Storage Account (you will see two storage accounts in the dropdown, be sure to select the Synapse Workspace Storage account and not the machine learning storage account)
- For this solution leave the Microsoft Dataverse as the default blank and click "Next"
- Click "Create"
In this step you will bring the data into the CI environment from your Azure Synapse Workspace.
- In the CI environment, navigate to the Data > Data Source
- Select
Add Data Source
and selectAzure data lake storage
, providesourcedata
for the data source name and click "Next".
- Note: Make sure you name the data source
sourcedata
as it is used in the Azure Synapse notebooks in later steps.
- Under "Connect your storage account using" select
Azure subscription
, select yoursubscription
,resource group
and theSynapse workspace storage account
you are using for this solution. Enterdata
for the Container
- Select
/default.manifest.cdm.json
and click "Next"
- Select all model entities and click "Next"
- Select all entities to enable data profiling and select "Save"
- Navigate to the Data Sources > Unify tab to Map, Match and Merge your data
In order to merge the data in later steps you will need to map at least 2 entities.
Mapping happens against default CI field types (e.g. ID, Person.Age, Location.City). This unifies data ingested from different sources and formats/types used in those sources.
- Select
+ Select entities
and select all entites
- Select
residents_source1
, set "cid" toPerson
, set the primary key tocid
- Note: Repeat the steps above for each source dataset below
-
Select
residents_source2
, set "cid" toPerson
, set the primary key tocid
-
Select
leases
, set "cid" toPerson
, set the primary key tolid
- Select
payments
, set "cid" toPerson
, set the primary key topaymentid
- Select
surveys
, set the primary key tosid
- Select
workorder
, set "cid" toPerson
, set the primary key towid
- Click "Save
Match records between entities based on matching IDs.
- Select "+ Set order", select
sourcedata:residents_source1
,sourcedata:residents_source2
, select "+ Add" at the bottom and selectsourcedata:surveys
- Select "+ Add rule" under
sourcedata:residents_source2
- Under "Select entity" select
residents_source1:sourcedata
, "Select field"Email
, "Normalize"Whitespaces, Symbols, Text to lower case, and Numerals
- Provide a name for the match rule
- Select "+ Add rule" under
sourcedata:surveys
- Under "Select entity" select
residents_source1:sourcedata
, "Select field"Email
, "Normalize"Whitespaces, Symbols, Text to lower case, and Numerals
- Provide a name for the match rule
- Select "+ Add rule" under
sourcedata:surveys
- Under "Select entity" select
residents_source2:sourcedata
, "Select field"Email
, "Normalize"Whitespaces, Symbols, Text to lower case, and Numerals
- Provide a name for the match rule
- Under Deduplicated Records select "+ Set entities", select
sourcedata:residents_source1
selectCreated_date
under "Based on field(s)",sourcedata:residents_source2
, selectCreated_date
under "Based on field(s)" and click "Done"
- Select "+ Add rule" under
sourcedata:residents_source1
, set the field tocid
, provide a name for the rule and click "Done"
- Select "+ Add rule" under
sourcedata:residents_source2
, set the field tocid
, provide a name for the rule and click "Done" - Click "Save" in the top of the Match page
The last step is merging the records. If fields need to be combined, that can be done as well.
- Select each
FirstName
column from the list
- Select "Combine" at the top of the Merge page
- Repeat these steps for Name, LastName, Gender, Telephone, Country, StreetAddress, City, State, PostCode, DateofBirth, CreatedDate, Source, and Email
- Note: Only combine the Email for
resident_source1
andresident_source2
- Note: Only combine the Email for
- Rename the Email column from the surveys dataset to
SurveyEmail
- Note: Make sure you rename this column to
SurveyEmail
as it is used in the Azure Synapse notebooks in later steps.
- Click Run at the top of the Merge tab and select "Run Merge and downstream processes"
-
Navigate to the Data > Export tab and click "+ Create export"
-
Select "+ Add Connection", select Azure Synapse Analytics
- Enter
CISynapseConnection
for the Display name, select your Azure Subscription and Azure Synapse worksapce you are using for this solution accelerator - Select 'I Agree' check box for Data privacy and compliance and click "Save"
- Enter
-
Provide
CustomerProfileExport
for the Display name, enterciexport
for Database name, select "Customer" under Profiles, click "Save" and Run the export.
- Navigate to Step 6 in the Azure Set Up Documentation and follow the Azure set up to complete Step 6 and 7.
Define the relationship between the Activity Entity
- Navigate to the Data > Relationship tab and click "+ New relationship"
- Provide a name for the relationship
- Under Source details select
payments:sourcedata
for "Entity",Many
for "Cardinality" andcid
for "Source field" - Under Target details select
residents_source1:sourcedata
for "Entity",One
for "Cardinality" andcid
for "Target field" and click "Save"
- Navigate to the Data > Relationship tab and click "+ New relationship"
- Provide a name for the relationship
- Under Source details select
payments:sourcedata
for "Entity",Many
for "Cardinality" andcid
for "Source field" - Under Target details select
residents_source2:sourcedata
for "Entity",One
for "Cardinality" andcid
for "Target field" and click "Save"
- Provide a name for the relationship
- Under Source details select
leases:sourcedata
for "Entity",Many
for "Cardinality" andcid
for "Source field" - Under Target details select
residents_source1:sourcedata
for "Entity",One
for "Cardinality" andcid
for "Target field" and click "Save"
- Provide a name for the relationship
- Under Source details select
leases:sourcedata
for "Entity",Many
for "Cardinality" andcid
for "Source field" - Under Target details select
residents_source2:sourcedata
for "Entity",One
for "Cardinality" andcid
for "Target field" and click "Save"
- Provide a name for the relationship
- Under Source details select
workorders:sourcedata
for "Entity",Many
for "Cardinality" andcid
for "Source field" - Under Target details select
residents_source1:sourcedata
for "Entity",One
for "Cardinality" andcid
for "Target field" and click "Save"
- Provide a name for the relationship
- Under Source details select
workorders:sourcedata
for "Entity",Many
for "Cardinality" andcid
for "Source field" - Under Target details select
residents_source2:sourcedata
for "Entity",One
for "Cardinality" andcid
for "Target field" and click "Save"
In this step, you will create an activity for WorkOrders, Leases, and Payments
- Navigate to the Data > Activites tab and click "Add activity"
- Provide a name for the activity, select
workorders:sourcedata
under "Entity", selectwid
under "Primary key" and click "Next"
- Select "+ Add relationship", select
cid
from resident_source1 as the Foreign key - Select "+ Add another relationship", select
cid
from resident_source2 as the Foreign key and select "Next"
- Select
workorder_type
for "Event activity",ServiceCompleteDate
for "Timestamp",ServiceRequestDate
for "Additional details",Yes
under "Show this information in the timeline view on your customer profile?" and click "Next"
- Select
ServiceActivity
for "Activity type" and click "Next"
- Review and Save the Activity
- Navigate to the Data > Activites tab and click "Add activity"
- Provide a name for the activity, select
payments:sourcedata
under "Entity", selectpaymentid
under "Primary key" and click "Next" - Select "+ Add relationship", select
cid
from resident_source1 as the Foreign key - Select "+ Add another relationship", select
cid
from resident_source2 as the Foreign key and select "Next" - Select
amount
for "Event activity", selectpaymentdate
for "Timestamp",paymentmethod
for "Additional details", the shopping bag for "Icon",Yes
under "Show this information in the timeline view on your customer profile?" and click "Next" - Select
SalesOrderLine
for Activity type and selectyes
to enable semantic mapping - Select
paymentid
for "Order line ID",paymentid
for "Order ID",paymentdate
for "Order date",amount
for Amount" and click "Next"
- Review and Save the Activity
- Navigate to the Data > Activites tab and click "Add activity"
- Provide a name for the activity, select
leases:sourcedata
under "Entity", selectlid
under "Primary key" and click "Next" - Select "+ Add relationship", select
cid
fromresident_source1
as the Foreign key - Select "+ Add another relationship", select
cid
fromresident_source2
as the Foreign key and select "Next" - Select
Type
for "Event activity", selectSignedDate
for "Timestamp",LeaseTerm
for "Additional details",Yes
under "Show this information in the timeline view on your customer profile?" and click "Next" - Select
Subscription
for Activity type and selectyes
to enable semantic mapping - Select
lid
for "Transaction ID",SignedDate
for "Transaction Date",lid
for "Subscription ID",StartDate
for "Subscription start date",EndDate
for "Subscription end date",Type
for "Subscription Type" and click "Next" - Review and Save the Activity
- Click "Run" at the top of the Activities page
In this step you will create Measures for Leases Ending in 90 Days, Life Time Value, and Number of Air Conditioning Work Orders. These Measures can be used in Segments
- Navigate to the Measure tab, click "+ New" and select "Build your own"
- Select "Dimensions", click the trash can icon to remove the dimension and click "Apply"
- Note: removing the dimension enables you to create the measure as a Customer Measure vs a Customer Attribute
- Select "Edit name" and provide a name for your measure
- Select "Filter", select
sourcedata_leases.EndDate
from the attributes list, set the filter to before 90 days after today - Select
sourcedata_leases.EndDate
from the attributes list, set the filter to after 0 days before today and click "Apply"
- Select "Edit name" under the Calculation, provide
Lease Ending in 90 Days Source 1
for the calculation name, select "count" from the dropdown, select "+ Add attribute", selectsourcedata_leases.lid
and select "Add"
- Click "Save and close"
- Select Edit on the "Lease Ending in 90 Days Source 1"
- Select "Dimensions", select
CustomerInsights.CustomerId
and select "Apply"
- Select "Relationship", select
sourcedata_leases > sourcedata_residents_source1 > Customer
and select "Done"
- Select "Run"
Repeat the steps from 6.1 for Source 2
- Navigate to the Measure tab, click "+ New" and select "Build your own"
- Select "Dimensions", click the trash can icon to remove the dimension and click "Apply"
- Select "Edit name" and provide
Lease Ending in 90 Days Source 2
for your measure name - Select "Filter", select
sourcedata_leases.EndDate
from the attributes list, set the filter to before 90 days after today - Select
sourcedata_leases.EndDate
from the attributes list, set the filter to after 0 days before today and click "Apply"
- Select "Edit name" under the Calculation, provide
Lease Ending in 90 Days Source 2
for the calculation name, select "count" from the dropdown, select "+ Add attribute", selectsourcedata_leases.lid
and select "Add" - Click "Save and close"
- Select Edit on the "Lease Ending in 90 Days Source 2"
- Select "Dimensions", select
CustomerInsights.CustomerId
and select "Apply"
- Select "Relationship", select
sourcedata_leases > sourcedata_residents_source2 > Customer
and select "Done" - Select "Run"
Repeat the steps from 6.1 and 6.2 to combine the two measures
- Navigate to the Measure tab, click "+ New" and select "Build your own"
- Select "Dimensions", click the trash can icon to remove the dimension and click "Apply"
- Select "Edit name" and provide
Lease Ending in 90 Days
for your measure name - Select "Edit name" under the Calculation, provide
Lease Ending in 90 Days
for the calculation name and click "Done" - Select Sum from the drop down
- Select "+ Add attribute", select "Measures", select
LeasesEndingin90DaysSource1.LeasesEndingin90DaysSource1
from the measures list and click "Add"
- Select "+", select "Add atributes", select "Measures", select
LeasesEndingin90DaysSource2.LeasesEndingin90DaysSource2
from the measures list and click "Add"
- Click "Save and close"
- Select Edit on the "Lease Ending in 90 Days"
- Select "Dimensions", select
CustomerInsights.CustomerId
and select "Apply"
- Select "Run"
- Navigate to the Measure tab, click "+ New", select "Choose a template" and select "Get started"
- Select
All time
for "Set time period" and click "+ Add data"
- Select
SalesOrderLine
from the dropdown and select "Next" - Select
SalesOrderLine
for the Activity type,SalesOrderLine:CustomerInsights
for Activity entity,sourcedata_payments
for Activities and click "Next"
- Select Transaction value and Activity timestamp as shown below and click "Save"
- Change the name of the measure to
TTV
- Navigate to the Measure tab, click "+ New" and select "Build your own"
- Select "Edit name" and provide
CTTV
or your measure name - Select "Edit name" under the Calculation, provide
CTTV
for the calculation name and click "Done" - Select Max from the dropdown
- Select "+ Add attribute", select "Measures", select
TTV.TTV
from the measures list and click "Add" - Click "Run"
- Navigate to the Measure tab, click "+ New" and select "Build your own"
- Select "Dimensions", click the trash can icon to remove the dimension and click "Apply"
- Select "Edit name" and provide
Number of Air Conditioning Work Orders Source 1
for your measure name - Select Filter, select
sourcedata_workorders.Workorder_type
from the attributes list, set the filter to is equal to Air Conditioning, select "Ignore case" and click "Apply"
- Select "Edit name" under the Calculation, provide
Number of Air Conditioning Work Orders Source 1
for the calculation name, select "count" from the dropdown, select "+ Add attribute", selectsourcedata_workorders.wid
and select "Add" - Click "Save and close"
- Select Edit on the "Number of Air Conditioning Work Orders Source 1"
- Select "Dimensions", select
CustomerInsights.CustomerId
and select "Apply"
- Select "Relationship", select
sourcedata_workorders > sourcedata_residents_source1 > Customer
and select "Done" - Select "Run"
Repeat the steps from 6.5 for Source 2
- Navigate to the Measure tab, click "+ New" and select "Build your own"
- Select "Dimensions", click the trash can icon to remove the dimension and click "Apply"
- Select "Edit name" and provide
Number of Air Conditioning Work Orders Source 2
for your measure name - Select Filter, select
sourcedata_workorders.Workorder_type
from the attributes list, set the filter to is equal to Air Conditioning, select "Ignore case" and click "Apply"
- Select "Edit name" under the Calculation, provide
Number of Air Conditioning Work Orders Source 2
for the calculation name, select "count" from the dropdown, select "+ Add attribute", selectsourcedata_workorders.wid
and select "Add" - Click "Save and close"
- Select Edit on the "Number of Air Conditioning Work Orders Source 2"
- Select "Dimensions", select
CustomerInsights.CustomerId
and select "Apply"
- Select "Relationship", select
sourcedata_workorders > sourcedata_residents_source2 > Customer
and select "Done" - Select "Run"
Repeat the steps from 6.5 and 6.6 to combine the two measures
- Navigate to the Measure tab, click "+ New" and select "Build your own"
- Select "Dimensions", click the trash can icon to remove the dimension and click "Apply"
- Select "Edit name" and provide
Number of Air Conditioning Work Orders
for your measure name - Select "Edit name" under the Calculation, provide
Number of Air Conditioning Work Orders
for the calculation name and click "Done" - Select Sum from the drop down
- Select "+ Add attribute", select "Measures", select
NumberofAirConditioningWorkOrdersSource1.NumberofAirConditioningWorkOrdersSource1
from the measures list and click "Add" - Select "+", select "+ Add attribute", select "Measures", select
NumberofAirConditioningWorkOrdersSource2.NumberofAirConditioningWorkOrdersSource2
from the measures list and click "Add"
- Click "Save and close"
- Select Edit on the "Number of Air Conditioning Work Orders"
- Select "Dimensions", select
CustomerInsights.CustomerId
and select "Apply"
- Select "Run"
- Navigate to the Measure tab, click "+ New" and select "Build your own"
- Select "Edit name" and provide
CSAT
or your measure name - Select "Edit name" under the Calculation, provide
CSAT
for the calculation name and click "Done" - Select Average from the dropdown
- Select "+ Add attribute", select
sourcedata_surveys.answer
from the attributes list and click "Add", select "*" and enter 20 - Click "Run"
- Navigate to the Segments tab and click "+ New", select "Blank segment", click "Edit details" and provide a name for your segment.
- Select the
LeasesEndingin90Days.LeasesEndingin90Days
measure from the Attributes list, select "greater than or equal to" from the dropdown and enter "1" under Enter Value - Select the dropdown and select "Intersect"
- Select "+ Add rule", select the
NumberofAirConditioningWorkOrders.NumberofAirConditioningWorkOrders
measure from the Attributes list, select "greater than or equal to" from the dropdown and enter "1" under Enter Value, and select "Save"
Follow steps 1-3 above and click "Save"
Now that you have created segments in the CI environment, you can export the data to Dynamics 365 Marketing
Customer Insights comes with some out-of-box prediction models.
- Customer Lifetime Value (CLTV)
- Customer Churn Model
- Product Recommendations
For the purpose of this solution accelerator, we will use the following model(s) as examples. They can be created based on your specific definitions and calculations:
- Resident CLTV
- Navigate to the Intelligence > Predictions tab, select "Create" and select "Use model" on the "Customer lifetime value (preview)" model
- Select "Get started"
- Provide a name for your model
- Select "3 Month(s)" under "Predict customer value over the next:"
- Select "Let model calculate purchase interval (recommended)" under "An active customer has spent money on your products or services in the last:"
- Select "Model calculations (recommended)" under " Determin high-value customers using:"
- click "Next"
- Select "+ Add data", select "SalesOrderLine" from the dropdown, select "payments:sourcedata" under Activities and click "Next"
- Keep the default values and click "Save"
- Leave "Additional data (optional)" blank and click "Next"
- Select "Never" under "Automatically import updated data" and click "Next"
- Click "Run" to save and run the model
- Navigate to the Measure tab, click "+ New" and select "Build your own"
- Select "Dimensions", click the trash can icon to remove the dimension and click "Apply"
- Select "Edit name" and provide
CLTV
for your measure name - Select "Edit name" under the Calculation, provide
CLTV
for the calculation name and click "Done" - Select Sum from the drop down
- Select "+ Add attribute", select
CLTVModel.CLVScore
from the attributes list and click "Add" - Click "Save and close"
- Select Edit on the "CLTV"
- Select "Dimensions", select
CustomerInsights.CustomerId
and select "Apply"
- Select "Run"
- Navigate to Intelligence > Custom models and select "+ New workflow"
- Provide a Name, select your tenant and Azure Machine Learning workspace, select your AML PiIpeline name for "Web service that contains your model" and click "Next
- Select the Entity for each of the "Web service input" as shown below and click "Next"
- Provide an entity name, an output data store and output path as shown below and click "Next"
- Select "cid" for the Customer ID and click "Save"
- Navigate to the Measure tab, click "+ New" and select "Build your own"
- Provide a name for your measure
- Select the "Average" function, enter
LeaseRenewalPrediction.RenewalPredictionScore * 100
in the attribute field
- Click "Save and close"
- Navigate to Data > Enrichments and click "+ Add enrichment"
- Select Interests and select "Next"
- Under Enter interests manually search the following five interests as shown below and click "Next"
- Select "Low" and "Exact (recommended)" as shown below and click "Next"
- Select "Customer" for Customer data set and click "Next"
- Select the Demographics ad Location as shown below and click "Next"
- Review and run your Interests Enrichment
- Navigate to Data > Enrichments and click "+ Add enrichment"
- Select Brands and select "Next"
- Under Enter brands manually search the following five brands as shown below and click "Next"
- Select "Low" and "Exact (recommended)" as shown below and click "Next"
- Select "Customer" for Customer data set and click "Next"
- Select the Demographics ad Location as shown below and click "Next"
- Review and run your Brands Enrichment
In this step you will bring the Lease Renewal Preductions data into the CI environment from your Azure Synapse Workspace.
- In the CI environment, navigate to the Data > Data Source
- Select
Add Data Source
and selectAzure data lake storage
, providepredictions
for the data source name and click "Next".
- Under "Connect your storage account using" select
Azure subscription
, select yoursubscription
,resource group
and theSynapse workspace storage account
you are using for this solution. Enterdata
for the Container
- Select the
synapse
folder, selectdefault.manifest.cdm.json
and click "Next"
- Select all model entities and click "Next"
- Select all entities to enable data profiling and select "Save"
- Provide a name for the relationship
- Under Source details select
LeaseResewalPrediction:predictions
for "Entity",One
for "Cardinality" andCustomerId
for "Source field" - Under Target details select
Customer:CustomerInsights
for "Entity",One
for "Cardinality" andCustomerId
for "Target field" and click "Save"
- Navigate to the Measure tab, click "+ New" and select "Build your own"
- Select "Dimensions", click the trash can icon to remove the dimension and click "Apply"
- Select "Edit name" and provide
Lease Renewal Predictions
for your measure name - Select "Edit name" under the Calculation, provide
Lease Renewal Predictions
for the calculation name and click "Done" - Select
First
from the drop down - Select "+ Add attribute", select
predictions_lease_renewal_prediction.RenewalPrediction
from the attributes list and click "Add" - Click "Save and close"
- Select Edit on the "Lease Renewal Predictions"
- Select "Dimensions", select
CustomerInsights.CustomerId
and select "Apply" - Select "Relationship", select
predictions_lease_renewal > Customer
and select "Done" - Select "Run"
-
Open the Power BI report in this repository
-
Click the Transform data dropdown and click Data source settings
- Select the Azure Synapse Workspace connection, select "Change Source..." and provide your SQL Server Database name under Server and click "OK"
- Navigate to the Synapse Workspace overview page in the Azure Portal, copy the Serverless SQL endpoint
- Select "Edit Permissions", under Credentials select "Edit", sign in to your Microsoft Account, click "OK" and click "Close"
- Click Transform data dropdown and click Transform data
- Select UnifiedActivity on the left under Queries, select Home and click Advanced editor
-
Replace InstanceId with your CI instance ID and click "Done"
- Navigate to your CI environment and copy the instance id in the URL of the webpage
-
Repeat step 7 for the Customer, LeaseRenewalPredictions, SalesOrderLine, Customer_Measure, InterestAffinityFromMicrosoft, BrandAffinityFromMicrosoft, LeasesEndingin90Days, Subscription and TTV queries
-
Select Home and click "Close & Apply"
-
Click Refresh Data