Dynamic Pricing Model Project
Project Summary:
The goal of this project was to provide a company with a pricing model that enabled their sales team to adjust pricing for in-progress opportunities in Salesforce, aligning them with successfully closed-won opportunities with similar characteristics. The team utilized Salesforce and the Google Cloud Platform product suite to deliver this solution.
Requirements:
As shown in the entity relationship diagram, the team started by understanding the project requirements. The company needed a pricing model that referenced data from their Salesforce environment and wanted the potential for first-party data enrichment in the future. The engineering team identified the necessary objects for the initial model as the Contact, Account, and Opportunity objects.
The client required the model to be updated on a scheduled basis, at least once per day. To achieve this, the Lakefront team set up a data transfer service to bring in Salesforce object data on a schedule into BigQuery. Additionally, the client wanted the ability to embed the model results in Salesforce in several locations. To meet this requirement, the Lakefront team created an embedded Lightning page to allow management to review model scores and performance at an aggregate level, as well as custom Lightning web components on Opportunity details pages to display individual model results by opportunity.
Implementation:
First, the Lakefront team collected the data from Salesforce by setting up the transfer service within BigQuery, configuring the data to update daily. Once the data was set up in a landing zone in BigQuery, the team used Dataform to model the data into its final Feature Dataset. The team employed BigQuery ML to run the model and produce the predicted pricing for all in-progress opportunities.
With the scored data, the team created a Streamlit application and developed a script that allowed data to pass from BigQuery into the application. The Streamlit application was then configured to run in App Engine and was embedded in a Salesforce Lightning page for management review. The model dataset scores were also configured to appear on custom Lightning web components within Opportunity details pages, with functionality to update pricing on the opportunity based on the model pricing provided.
Conclusion:
The scores have enabled the client to improve the consistency of their sales team's pricing strategy, leading to less volatility in opportunity pricing. This improvement has facilitated more advanced sales analysis and informed strategy when considering their collection of offerings and customer targets.