Catalog / Personalisation, Recommendation & Marketing Analytics / REC-004

Customer segmentation

Group customers into behaviour-, value- and need-based segments with clustering, embeddings and LLM-generated segment descriptions so marketing, product and service teams can target them differently.

Quick win: proven, manageable effort, first results within weeks, low regulatory risk.

Treating all customers alike wastes budget; hand-built segments ("age 30-45, urban") are coarse and go stale. AI segmentation finds groups from actual behaviour (what people buy, browse, cancel, ask support), scores them by value and risk, and uses an LLM to turn clusters into readable personas. The result feeds campaigns, pricing tests, product roadmaps and service routing. In the EU the key design question is not the algorithm but the legal basis, data minimisation and avoiding sensitive or discriminatory proxies.

Problem & value

  • Today: marketing teams use RFM tables (recency, frequency, monetary value), static demographic rules or agency-built personas refreshed once a year. Analysts run ad-hoc k-means in notebooks that are not reproducible or wired to activation channels.
  • AI value: (1) richer features from event streams and text, (2) segments that update continuously, (3) explanations a business user understands, (4) direct activation in CRM/email/ads, (5) segment-level measurement of uplift instead of average campaign results.
  • Evidence: vendors and consultancies publish personalisation uplift claims, but they are self-selected and vary widely; measure your own gain with a holdout group rather than relying on quoted percentages. Segmentation by itself creates no value until a different action is attached to each segment.

Variants

  • Behavioural / RFM+ segmentation: purchase and usage patterns, the classic and most robust form.
  • Value-based: segments by predicted customer lifetime value and churn risk (PRED-004, PRED-003).
  • Needs / attitudinal: clustering of survey answers, reviews and support text with embeddings.
  • B2B account segmentation: firmographics, product usage and buying-committee signals (REC-010).
  • Lookalike and propensity audiences: seed segment to scored prospects, mostly for acquisition ads.
  • Public sector / nonprofit: citizen or donor groups for service design and fundraising; stricter proportionality and transparency expectations.
  • Private use: not applicable beyond personal-finance categorisation.

How it works

  1. data sources (CRM, shop, app events, consented web analytics, tickets, surveys)
  2. identity resolution & consent filter (drop non-consented / sensitive fields)
  3. feature engineering (RFM, recency-weighted events, category affinities, text embeddings)
  4. dimensionality reduction (PCA / UMAP / autoencoder)
  5. clustering (k-means, Gaussian mixture, HDBSCAN) or supervised value/propensity models
  6. validation (stability across runs, silhouette, business interpretability, fairness check)
  7. LLM profiling: summarise top features + sample text into persona, name, suggested actions
  8. human review by marketing/analytics (merge, rename, reject segments)
  9. activation (CRM, ESP, ad audiences, service routing) + holdout measurement
  10. scheduled refit and drift monitoring
  • Clustering is unsupervised: there is no ground truth, so quality is judged by stability and by whether segments respond differently to treatments. Prefer few (5-12) actionable segments.
  • LLM role: never assign customers by prompting an LLM per person; use it to label and describe clusters from aggregate statistics, to cluster free text via embeddings, and to draft segment-specific messaging.
  • Human-in-the-loop: analysts approve segment definitions; marketing owns the action per segment; privacy/DPO reviews the feature list.

Data preparation

Data needed: customer master data, orders and transactions, product categories, web and email engagement, service contacts and optionally survey or review text. In an SMB these are spread across ERP, shop system, CRM, newsletter tool and Excel files.

Typical gaps: duplicate customers, B2B and B2C mixed, no common customer ID, inconsistent product categories, missing consent flags, outliers (returns, test orders) and historic data that is only in spreadsheets.

Preparation steps: - Export from ERP, shop and CRM and merge on one customer ID (PREP-005); restructure spreadsheets into tidy tables (PREP-011). - Deduplicate, remove test orders and define RFM features (recency, frequency, monetary value). - Agree KPI and segment definitions with the business (PREP-012) and check the purpose and legal basis (PREP-025). - Pseudonymise extracts for modelling (PREP-022).

Tools: SQL or Python (pandas), dbt, OpenRefine for deduplication, CRM export, Metabase for review.

Effort share: roughly 30-40 percent of the project; a first RFM segmentation is possible within days once data is joined. See also GUIDE-003.

Implementation paths

Which path for whom

  • SMB: A. CRM and email tools (HubSpot, Brevo, Klaviyo, Mapp) include AI segments and smart lists; the data is already there and the process is standard.
  • Enterprise: B. Segments combine finance, product and service data, so warehouse-native modelling with own logic fits better than a closed CDP.
  • Developer: C. scikit-learn, hdbscan and Metabase on HW1 cover clustering of millions of customers without sending data out.
  • Customer data platforms and marketing clouds with AI audiences: Adobe Real-Time CDP / Experience Platform, Salesforce Data Cloud, Braze, Klaviyo, HubSpot (predictive/smart lists), Segment (Twilio), mParticle, Bloomreach (EU-founded, Czech/Slovak roots), emarsys by SAP (EU), Optimove, Mapp (EU, Germany), Cleverreach (EU, Germany), Brevo (EU, France).
  • Analytics-side: Piwik PRO (EU, Poland) and Matomo (EU, France/NZ origin, self-hostable) for consent-aware behavioural segments.
  • Choose A when: data already sits in a shop or CRM system, the team is small, and segments are mainly used for email and ads. Check: EU data residency, consent-state synchronisation, export of segment logic (avoid lock-in), explainability of the "AI segments".

Path B — Build on cloud APIs

  • Warehouse-native ML: BigQuery ML (k-means, matrix factorisation, EU multi-region), Snowflake Cortex and Snowpark ML, Databricks (EU regions), Azure Machine Learning, Amazon SageMaker (Frankfurt/Paris/Stockholm).
  • Text and persona layer: embeddings and LLM APIs from EU-hosted or EU-region offerings (Mistral, Azure OpenAI EU data zone, Google Vertex AI EU, Amazon Bedrock EU, Anthropic Claude via EU region) for clustering reviews and ticket text and for generating persona cards.
  • Reverse ETL for activation: Hightouch or Census-style sync, or dbt plus custom jobs.
  • Choose B when: you already have a warehouse and want segments computed with your own logic, joined with finance and product data.

Path C — Self-host (open source)

  • Modelling: scikit-learn (KMeans, GaussianMixture), hdbscan, UMAP, BERTopic for text topics, sentence-transformers or open embedding models (BGE-M3, multilingual-e5, Qwen3-Embedding), XGBoost/LightGBM for propensity models, Feast for features.
  • Open-source CDP / analytics: RudderStack, Matomo, Apache Superset or Metabase for dashboards, PostgreSQL with pgvector or Qdrant.
  • LLM for personas: a small instruction model (Mistral, Llama, Qwen, Gemma class, ~7-8B) served with Ollama or vLLM is sufficient, since inputs are aggregate statistics.
  • Hardware: HW1 is enough for tabular clustering and small embeddings on up to millions of customers; HW2 only if you want a larger local LLM.

Path D — Custom training

Worth it for large customer bases (telco, retail, bank) where learned customer embeddings (sequence models over transactions or events, two-tower or transformer encoders) beat hand-built features and are reused for recommendation, churn and CLV. Requires long event histories and an ML platform; keep a simple RFM baseline to prove the added value.

State of the art (2026)

  • Representation learning: customer embeddings from event sequences and foundation models for tabular data (e.g. TabPFN-style models for small datasets) increasingly replace manual features; gains are largest when histories are long and behaviour is diverse.
  • LLM-assisted analytics: LLMs label clusters, mine themes from free text, and let marketers query segments in natural language ("customers who bought twice and went quiet"). Verify generated segment SQL; LLMs can silently misdefine filters.
  • Synthetic personas: LLM-simulated personas are popular for ideation but are not a substitute for real customer data and tend to reflect stereotypes; use only as a hypothesis aid.
  • Causal / uplift segmentation: segmenting by treatment response (uplift models, causal forests) is superior to segmenting by raw propensity for budget allocation (see REC-005).
  • Privacy-enhancing approaches: cohort and clean-room analysis, differential privacy and on-device processing grow as third-party cookies and identifiers weaken.
  • Limits / failure modes: unstable clusters, "segments of one" that cannot be acted on, proxies for protected attributes (postcode as ethnicity, name as gender), feedback loops (only targeted segments generate data), and over-claiming causal meaning from descriptive clusters.

Shared resources & combinations

  • Same stack (tabular-ml + embedding-text + llm-general): PRED-003 churn, PRED-004 CLV, REC-001 product recommendations, REC-009 loyalty personalisation all reuse the same feature store, embeddings and warehouse; one customer-embedding table can serve all.
  • Downstream: REC-003 next-best-action, REC-006 email personalisation and send-time optimisation, REC-007 audience building for ads, REC-005 budget allocation across segments.
  • Voice-of-customer text from support (see conversational/analysis use cases in CONV) can be clustered with the same embedding and vector-database infrastructure.

Effort, cost & KPIs

  • Path A: days to a few weeks to configure; typically subscription priced by profiles or events.
  • Path B: 1-3 months for data modelling, model pipeline and activation; cost mainly data engineering and warehouse compute.
  • Path C: 2-4 months; low compute cost, higher maintenance effort.
  • Path D: 4+ months and an ML team.
  • KPIs: uplift versus holdout (conversion, revenue per customer, retention) per segment; segment stability over time; share of customers in actionable segments; campaign cost per incremental order; time from data to activated audience; opt-out and complaint rates.

People & change

Involve: management and marketing or sales lead (process owner) to define what segments are for; IT and data owners for exports; the data protection officer for profiling, purpose limitation and consent (GUIDE-005); end users in marketing and sales who will act on segments, early in the design so that segments are named in business terms.

Works council: usually no, because customers are analysed, not employees, so §87(1) no. 6 BetrVG is not triggered. Inform the council if segments feed tools that track sales staff performance (§90(1) no. 3 BetrVG, GUIDE-004).

Data protection: AVV with every tool provider; a DPIA (Art. 35 GDPR) is likely only for large-scale profiling or sensitive attributes; avoid segments based on special categories.

AI literacy: under AI Act Art. 4, take measures that support staff AI literacy; explain to marketing how clustering works, that segments are statistical and not truth (GUIDE-006).

Pilot and communication: start with one campaign and a control group, compare against a simple RFM baseline. Typical concerns are stereotyping, black-box segments and discrimination; address them with readable segment profiles, regular review and human sign-off before activation. See GUIDE-009 and GUIDE-008.

Risks, regulation & compliance

  • EU AI Act: minimal risk for marketing segmentation. Escalation triggers: segments used for creditworthiness, insurance pricing/eligibility, employment or access to essential services (Annex III, possibly high-risk); and Art. 5 prohibitions on exploiting vulnerabilities due to age, disability or social/economic situation to materially distort behaviour, on manipulative or deceptive techniques, and on biometric categorisation inferring sensitive traits. Do not build segments that infer sensitive attributes. AI literacy (Art. 4) applies.
  • GDPR: segmentation is profiling (Art. 4(4)). Needs a legal basis (consent or carefully documented legitimate interest; ePrivacy / national cookie rules require consent for tracking), transparency (Arts. 13-14), right to object to profiling for direct marketing (Art. 21(2)-(3)), data minimisation and purpose limitation (Art. 5), and usually a DPIA (Art. 35) for large-scale profiling. Art. 22 applies if segmentation drives decisions with legal or similarly significant effects (pricing discrimination, credit); the CJEU SCHUFA ruling (C-634/21) read "decision" broadly, so even a score that others rely on can trigger Art. 22 [2][3]. Art. 9 special-category data (health, religion, sexual orientation) must not be inferred or used without explicit consent.
  • Other: Digital Services Act bans ad targeting on profiling using special-category data and profiling of minors on online platforms (Art. 26); UWG and national rules on unsolicited marketing; consumer pricing law (Omnibus Directive requires disclosure of personalised pricing).
  • Mitigations: privacy-by-design feature allow-list, exclude sensitive proxies, fairness review of segment composition, pseudonymised segment tables, retention limits, easy opt-out, holdout tests, documentation of segment logic, human sign-off.

Getting started

  1. Define the decision first: which action will differ per segment (offer, channel, service level)?
  2. Build an RFM baseline in the warehouse from one clean year of order data and check it with marketing.
  3. Add one richer signal (category affinity or text embeddings) and compare stability and response.
  4. Run a DPIA-light review: legal basis, consent flag per field, sensitive-attribute exclusion list.
  5. Activate two or three segments with a randomised holdout and measure uplift before scaling.

Sources

  1. Regulation (EU) 2024/1689 (AI Act), Art. 5 and Annex III — https://eur-lex.europa.eu/eli/reg/2024/1689/oj
  2. Regulation (EU) 2016/679 (GDPR), Arts. 4(4), 21, 22, 35 — https://eur-lex.europa.eu/eli/reg/2016/679/oj
  3. CJEU, Case C-634/21 SCHUFA Holding (Scoring), judgment of 7 Dec 2023 — https://curia.europa.eu/juris/liste.jsf?num=C-634/21
  4. Article 29 Working Party / EDPB — Guidelines on Automated individual decision-making and Profiling (WP251rev.01) — https://ec.europa.eu/newsroom/article29/items/612053
  5. Regulation (EU) 2022/2065 (Digital Services Act), Art. 26 — https://eur-lex.europa.eu/eli/reg/2022/2065/oj
  6. Google Cloud — BigQuery ML k-means clustering — https://cloud.google.com/bigquery/docs/kmeans-tutorial
  7. scikit-learn — Clustering — https://scikit-learn.org/stable/modules/clustering.html
  8. BERTopic documentation — https://maartengr.github.io/BERTopic/
  9. Matomo — https://matomo.org/