All use casesUse case · Marketing & CRM

Customer 360: From Scattered Data to Personal Campaigns

Customer information is spread across CRM platforms, websites, mobile apps, sales systems and support tools, so no team sees the whole customer. This use case shows one DataFloem pipeline that matches the same person across systems, builds one profile per customer, assigns a behavioural segment and writes campaign audiences to Apache Iceberg.

Industry
Marketing & CRM
Sources
Object storage (CSV, JSON), PostgreSQL, Elasticsearch
Output
Customer profiles and campaign audiences, in Iceberg
Each run
A batch job on Spark on Kubernetes, overwriting both tables
One customer appears under a different ID in Salesforce, HubSpot, the shop, the app and the help desk. One DataFloem flow merges the CRMs by e-mail, adds orders, activity and tickets node by node, previews Emma Walker as one VIP profile and writes the profiles and campaign audiences to Iceberg

At a glance

  • Challenge: customer information is spread across CRM platforms, websites, mobile apps, sales systems and support tools, so no team sees the whole customer.
  • Solution: one DataFloem pipeline reads every source, matches the same person across systems, builds one profile per customer, assigns a behavioural segment and writes campaign audiences to Apache Iceberg tables.
  • Value: a single customer view, segments that follow real behaviour, and campaign lists that respect consent, refreshed on every run.

The scenario

An illustrative scenario with synthetic data. It does not describe a specific customer.

An online fashion retailer has about five thousand active customers. Its marketing team wants to send the right message to the right person: early access for its best customers, a win-back offer for those who stopped buying, a reminder for abandoned carts, a welcome series for new buyers, and no promotion at all for customers who are waiting on a support ticket.

The data to make those decisions exists, but in six places:

  • Salesforce knows the sales contact, as Contact 0038d00001Kx with E.Walker@Example.com.
  • HubSpot knows the marketing contact, as vid 51207 with emma.walker@example.com.
  • The website knows a visitor and twelve page views.
  • The mobile app knows customerId 10001 and a product added to the cart.
  • The e-commerce platform knows fourteen orders worth $2,340.
  • The help desk knows ticket #8812, solved, with a satisfaction score of five.

They are all Emma Walker. No system knows that.

Why scattered customer data weakens every campaign

When customer data is fragmented, three things go wrong:

  • No shared identity. Each system has its own ID, and even the e-mail address is written differently from one tool to the next. The same person appears as two or three customers, and nobody can say how many customers there really are.
  • No shared picture of behaviour. Orders, browsing, app activity and support history live in separate tools. A customer who spends a lot but has an open complaint looks like a VIP to one team and a problem to another.
  • Segments built by hand. Lists are exported, merged in spreadsheets and uploaded to campaign tools. They are out of date the day after, and opt-outs are easy to miss.

The result is weaker segmentation, generic campaigns and retention analysis that comes too late.

The data sources

Source Where it lives What it contributes
Salesforce Daily CSV export in object storage Sales contacts, country, lead source, e-mail opt-out
HubSpot Daily JSON export in object storage Marketing contacts, lifecycle stage, e-mail opt-out
E-commerce platform PostgreSQL (shop.customers, shop.orders) Customer accounts, every order and its amount
Website analytics JSON event files in object storage Page views, add-to-cart, checkout
Mobile application JSON event files in object storage Product views, cart adds, purchases
Customer support system Elasticsearch index Tickets, status, topic, satisfaction score

The CRM platforms reach DataFloem as their regular exports, the most common pattern in practice. The same pipeline works the same way when those exports land in another bucket, folder or database.

Building the pipeline in DataFloem

The company uses DataFloem, a self-hosted data platform on Apache Spark and Kubernetes, as the one place where customer data is joined, cleaned and turned into audiences.

  1. Connect the sources. The object storage bucket with the CRM exports and the event files, the PostgreSQL shop database and the Elasticsearch support index are registered once as DataFloem sources and assigned to a Customer 360 project.
  2. Lay out the whole pipeline. In a single visual job, every source and every step is placed on the canvas first, so the team sees the full data flow before configuring a single node.
  3. Match the same person across CRMs. A SQL node maps each CRM export to one shared schema: e-mail addresses in lower case, first and last name joined into a full name, the opt-out flag as a number, and the source system on every row. A Union node puts Salesforce and HubSpot contacts into one list, and an Aggregation node groups it by e-mail address. The same person in both CRMs becomes one record, which keeps the most restrictive consent and counts how many CRM records were found.
  4. Turn activity into metrics. For orders, an Aggregation node counts orders per customer, adds up total spend and keeps the first and last order dates. For web and app, two SQL nodes bring browsing and app events into one event schema, a Union node merges them, and a SQL node counts events in the last thirty days, cart adds in the last seven days and the time of the latest cart add. For support, a SQL node counts open tickets and the average satisfaction score per customer.
  5. Build one profile per customer. A Join node matches shop accounts to the merged CRM records by e-mail. A SQL node then joins orders, engagement and support history with LEFT JOINs, so customers without orders or tickets are kept too. The result is one row per customer.
  6. Segment by behaviour. A SQL node applies a few readable rules, in order (see the table below). A second SQL node turns segments into audiences with campaign, offer and channel, and leaves out every customer who opted out of e-mail in either CRM.
  7. Check before running. A Partial Run executes every step on the cluster, and Data Preview shows the result of the segment step. Emma Walker appears once: two CRM records, fourteen orders, $2,340, a VIP.
  8. Write to the lakehouse and run. Two catalog target nodes write customer_360 and campaign_audiences as Apache Iceberg tables in the DataFloem catalog. The store strategy is Overwrite, so every run leaves exactly one current picture. The full job runs on a Spark cluster on the company's own Kubernetes, and its log is kept in DataFloem.
  9. Use the result. In DataFloem SQL Queries the marketing analyst counts customers and average spend per segment, then lists the at-risk customers with their win-back offer, ready to hand to the campaign tool.

Six segments, six messages

The rules are checked in this order, so a customer with an open ticket is never offered a sale, however much they spend.

Segment Rule Campaign Channel
Needs care An open ticket, or an average satisfaction of 2 or lower Service follow-up, no promotion Support
VIP Spend of $1,500 or more and an order in the last 25 days Early access to the new collection E-mail
At risk Three or more orders, none in the last 90 days Win-back, 15% off E-mail
Cart abandoner A cart add in the last 7 days with no purchase after it Free shipping reminder App push
New customer First order in the last 30 days Welcome series, 10% off the second order E-mail
Regular Everyone else No campaign None

Architecture

Sources
Salesforce exportCSV in object storage
HubSpot exportJSON in object storage
Web and app eventsJSON in object storage
PostgreSQLShop customers and orders
ElasticsearchSupport tickets
read in place
DataFloem visual job
On a Spark cluster on Kubernetes
normalizeunionmatch by e-mailaggregatejoinsegmentaudiences
written with Overwrite on every run
Iceberg tables in the DataFloem catalog
customer_360One row per customer, with segment
campaign_audiencesCampaign, offer, channel; opt-outs removed
Used by
SQL QueriesSegment sizes and campaign lists
Campaign and BI toolsAudiences ready to send

What it means for the business

Before With DataFloem
The same customer counted two or three times One record per customer, matched by e-mail across CRMs
Behaviour split across sales, web, app and support tools One profile with orders, engagement and support history
Segments rebuilt by hand in spreadsheets Readable rules, applied to every customer on every run
Opt-outs missed between tools Consent from both CRMs applied before any list is produced
Unhappy customers receive promotions Customers with open issues go to support, not to a sale
Campaign lists out of date the next day Audiences refreshed in the lakehouse with each run

The DataFloem capabilities it uses

Capability Role in this use case
Data integration Object storage (CSV and JSON), PostgreSQL and Elasticsearch sources
Data processing A visual job with SQL, Union, Aggregation and Join nodes
Workflow orchestration Partial runs with data preview, full runs on a managed Spark cluster, run logs
Lakehouse storage Apache Iceberg tables in the DataFloem catalog, overwritten on every run
SQL analytics Querying segments and campaign audiences in SQL Queries

See it in action

The video below shows the same use case in DataFloem, from one customer scattered across six systems to segment sizes and a win-back campaign list in SQL.

TimeWhat you see
One customer, six systems
Create the pipeline job
Read the Salesforce export
Merge Salesforce and HubSpot
Orders into customer metrics
Support tickets from Elasticsearch
One profile per customer
Segment by behaviour
Write to the lakehouse (Apache Iceberg)
Partial run and data preview
Run the pipeline
Segment sizes and a win-back campaign list

See it on your own customer data.

If your teams still merge customer lists in spreadsheets before every campaign, get in touch with the DataFloem team to see how one customer profile fits your systems.

ESC

Start typing to search across the documentation.