Building a single customer view, churn and lifetime value models, and product recommendations on a governed data platform
Wronit designed and delivered a customer analytics and machine learning platform for a multi-category online retailer in India. The platform consolidates order, behavioural, and customer service data into a single customer view, and uses that foundation to support churn risk scoring, customer lifetime value estimation, and product recommendations. Analytics and marketing teams access the results through dashboards and scheduled data feeds.
The client is an online retailer selling across several product categories, including apparel, home, and personal care, through a website and a mobile app. Customers range from first-time buyers arriving through promotions to long-standing repeat customers who buy across categories. Marketing, category management, and customer service teams all rely on customer data, but each had historically worked from its own extracts and reports.
The engagement called for a dependable, shared understanding of the customer. The retailer needed one place where a customer's orders, browsing behaviour, and service interactions could be seen together, and a way to turn that view into practical signals: which customers are at risk of lapsing, which are likely to be most valuable over time, and which products are relevant to each of them. The requirement went beyond building models. The models had to sit on data that the business already trusted, refresh on a predictable schedule, and produce outputs that marketing and analytics teams could act on without rebuilding the logic in spreadsheets.
Customer data in eCommerce is fragmented by design. The same person may browse anonymously on the app, sign in on the website, check out as a guest, and later contact customer service from a different email address. Order systems, analytics events, and service tools each describe that person in their own terms. The design challenge was to resolve those fragments into a reliable customer record without merging people who are actually different, and then to build predictive models that respect the limits of that record. A churn score is only as useful as the definition of churn behind it, and a recommendation is only as good as the product and behaviour data it learns from.
We began with the data foundation, because every later capability depends on it. The work covered ingestion, standardization, identity resolution, and a customer model that both analysts and machine learning pipelines could use.
Three primary sources were brought into the warehouse: order and transaction data from the commerce platform, behavioural event data from the website and mobile app, and case data from the customer service tool. Pipelines load each source on a defined schedule, with incremental loads for high-volume event data and full or merge-based loads for reference tables such as products and categories.
Each source lands first in a raw layer that keeps the data as received. A standardized layer then applies consistent naming, data types, time zones, and currency handling. Business logic is applied only after this step, so every derived figure can be traced back to source records.
Identity resolution links records that belong to the same customer. Deterministic rules come first: a matching customer account ID, or a verified email address used at checkout and in a service case. Weaker signals, such as a shared device identifier, are recorded as candidate links rather than merged automatically.
Illustrative identity scenarios and handling rules are shown below. They explain the approach and are not client records or the full production rule set.
| Scenario | Appropriate handling | Reason |
|---|---|---|
| Guest checkout uses the same verified email as an existing account | Link the order to the existing customer | A verified email is a strong deterministic identifier. |
| App and web sessions share a logged-in account ID | Merge the behaviour into one customer profile | The account ID establishes the same customer directly. |
| Two accounts share a delivery address but have different names and emails | Keep them as separate customers | A shared address often indicates a household, not one person. |
| Anonymous sessions share a device ID with a known customer | Record a candidate link with lower confidence | Devices can be shared, so the link should not drive merges by itself. |
| A service case uses a phone number found on two accounts | Flag the case for review | The data cannot establish which account it belongs to. |
The resulting customer model holds one row per resolved customer, with attributes the business agreed on: first and most recent order dates, order count, net revenue after returns and cancellations, category breadth, preferred channel, recent browsing activity, and service contact history. Each attribute has a written definition, so “active customer” or “net revenue” means the same thing in a dashboard as it does in a model.
Returns and cancellations deserve particular attention in eCommerce. A customer whose orders are frequently returned may look valuable on gross order value and much less so on net value. The model therefore records both figures, and downstream work uses the net figure unless a gross view is explicitly needed.
With a trusted customer model in place, we developed two related models: one estimating the risk that a customer will lapse, and one estimating their expected value over a defined future period.
Online retail has no subscription to cancel, so churn has to be defined in terms of behaviour. Working with the client’s teams, we defined lapse relative to each customer’s own purchase rhythm and the categories they buy from. A customer who buys every few weeks and goes quiet for three months is in a different position from one who buys seasonally.
The definition was set before modelling began and documented with examples. This mattered because changing the definition later would change what the model learns and what its scores mean.
Features such as recency, frequency, monetary value, category mix, discount reliance, return behaviour, browsing trends, and recent service contacts are computed in a shared feature layer. The same feature definitions serve the churn model, the lifetime value model, and analyst queries, which avoids the common problem of a model and a dashboard calculating “recent activity” in different ways.
Features are computed as of a specific point in time. When the model is trained on historical data, it sees only information that would have been available at that moment. This point-in-time discipline prevents future information from leaking into training and inflating apparent model quality.
The churn model is a gradient-boosted classification model trained on historical customer snapshots. It produces a risk score for each active customer, refreshed on a regular schedule. Scores are grouped into risk bands so marketing teams can work with a manageable set of segments rather than raw probabilities.
Each scored customer also carries the main contributing factors behind their score, such as a sharp drop in browsing or a recent unresolved service case. These explanations help teams choose an appropriate response. A customer drifting away from a category needs a different message from one who has just had a poor service experience.
The lifetime value model estimates the expected net value of each customer over a defined forward period. It combines purchase frequency and spend patterns with return behaviour, so customers who place many heavily returned orders are not overvalued.
Lifetime value and churn risk are most useful together. A high-value customer with rising risk warrants attention, while a low-value customer with high risk may not justify an expensive retention offer. The platform presents both measures side by side for that reason.
The examples below show how churn risk and value can guide different actions. They are illustrative segments, not client data or a prescribed campaign plan.
| Illustrative segment | Churn risk band | Value band | A reasonable response |
|---|---|---|---|
| Long-standing multi-category buyer, browsing declining | Rising | High | Personal outreach or relevant category recommendations, not a blanket discount |
| Recent first-time buyer from a promotion | High | Low to medium | Second-purchase journey focused on relevance |
| Frequent buyer with high return rate | Low | Medium on a net basis | Review fit and sizing guidance before promotional spend |
| Customer with a recent unresolved service case | Rising | Any | Resolve the service issue before marketing contact |
The third model generates product recommendations. It supports “recommended for you” placements, “frequently bought together” suggestions, and personalized product lists for email and app campaigns.
The recommendation approach combines collaborative signals, meaning what similar customers viewed and bought, with product attributes such as category, brand, and price band. Collaborative signals capture patterns that catalogue data alone cannot express. Product attributes keep recommendations sensible for new products and for customers with little history, where behavioural data is thin.
Business rules are applied after the model scores products. Out-of-stock items, products the customer has already bought where repurchase is unlikely, and items outside agreed category or brand rules are filtered out. Keeping these rules separate from the model makes them easy to review and change without retraining.
Recommendations are produced as scheduled outputs and delivered to the systems that use them: campaign tools for email and push messaging, and a feed the commerce platform can read for on-site placements. The platform can therefore support recommendations across several channels without each channel maintaining its own logic.
The logical architecture follows a layered pattern. Source systems feed raw and standardized data layers in the warehouse or lakehouse. The customer model and shared feature layer sit on top of these. Machine learning pipelines read from the feature layer to train and score the churn, lifetime value, and recommendation models. Scores and recommendations are written back to the warehouse, where the dashboard layer and data feeds pick them up.
This is a reference design, not an infrastructure inventory. The same pattern can run on a cloud data warehouse or a lakehouse, using the major cloud platforms’ managed services or open-source orchestration and machine learning tooling. The choice depends on the client’s existing environment, skills, and governance requirements.
Models are versioned, and each scoring run records which model version and feature snapshot it used. Monitoring checks input data for unexpected shifts, such as a sudden change in event volumes after an app release, and tracks model performance against observed outcomes as they become available.
The dashboard layer gives business teams direct access to the single customer view and the model outputs. Views include customer base composition, cohort retention, churn risk distribution, value bands, and recommendation coverage. Marketing teams can export defined segments to campaign tools without building their own queries.
Dashboards draw on the same customer model and feature definitions as the models themselves. When a marketing manager sees a count of high-risk, high-value customers, it matches the segment the campaign tool receives.
The engagement gave the retailer a consolidated customer data foundation and a set of production machine learning capabilities built on it. The delivered scope included:
Together, these capabilities replace fragmented extracts with a shared customer foundation and give the retailer’s teams consistent, explainable signals to plan retention, personalization, and marketing activity.
The value of a customer analytics platform should be measured as the business uses it. The measures below form a suitable measurement framework for a platform of this kind. They are not reported results from this engagement.
| Measure | Definition |
|---|---|
| Identity match rate | Customer records linked by deterministic rules divided by all customer records evaluated. |
| Churn model calibration | Agreement between predicted risk bands and observed lapse rates over the evaluation period. |
| Retention lift versus holdout | Difference in repeat purchase rate between treated customers and a randomized holdout group. |
| Recommendation engagement | Clicks or purchases on recommended products divided by recommendation impressions, compared against a non-personalized baseline. |
| Data freshness | Elapsed time between source activity and its availability in the customer model and dashboards. |
| Segment consistency | Sampled dashboard segment counts that match the corresponding exported segments divided by all samples checked. |
Holdout groups are central to responsible measurement. Without a comparison group, it is difficult to tell whether a retention campaign changed customer behaviour or simply reached customers who would have returned anyway.
For this online retailer, Wronit built a customer analytics platform that starts with trustworthy data and extends to churn risk, lifetime value, and product recommendations. Careful identity resolution, agreed definitions, and a shared feature layer keep the models and the dashboards consistent with each other and with the business.
For retailers planning similar work, begin with the customer data you already have and the decisions your teams need to make. Wronit can bring data engineering, machine learning, and analytics together into a single platform that supports those decisions over time.