49  Marketing Analytics: Segmentation, Campaigns, and Attribution

49.1 Why Marketing Analytics Matters

Half my advertising is wasted, I just don’t know which half — Wanamaker’s confession was written before the data existed to answer it.

Marketing is the function where the gap between intent and evidence is largest. Brand teams spend on television, search, social, influencers, sponsorships, and trade promotions, often in the same quarter, and historically could only defend a fraction of that spend with hard numbers. Marketing analytics is the discipline that closes that gap.

For a BI analyst, marketing throws up three recurring questions, and a different family of dashboards answers each one. Who is the customer? is answered by segmentation. Did the campaign work? is answered by campaign measurement. Which channel deserves the credit? is answered by attribution. Michel Wedel & Wagner A. Kamakura (2000) describe segmentation as the foundation on which marketing strategy stands — without a segmentation that managers actually use, the rest of marketing analytics is a search for averages. P. K. Kannan & Hongshuang “Alice” Li (2017), surveying the digital marketing literature, argue that the modern customer journey crosses so many touchpoints that attribution has become a first-order analytical problem, not a footnote.

TipThree questions, three dashboards
  1. Who? — Segmentation dashboards: clusters, RFM tiers, persona cards.
  2. What worked? — Campaign dashboards: pre-post lift, funnel conversion, ROAS.
  3. What gets credit? — Attribution dashboards: touch sequences, model comparison, channel contribution.

A single marketing dashboard that tries to answer all three usually answers none of them well. Build them as separate views with shared filters.

49.2 Customer Segmentation: From Demographics to Behaviour

Segmentation is the act of dividing a heterogeneous customer base into smaller groups that are internally similar and externally distinct, in ways that matter for action (Michel Wedel & Wagner A. Kamakura, 2000). The art is in choosing variables that predict behaviour rather than describe demography. Two customers with the same age and city can shop completely differently; segmentation that ignores behaviour misses the bigger lever.

TipFive Families of Segmentation, Each With a Distinct Visualisation Idiom
Base Variables Data source Visualisation lens
Demographic Age, gender, income, education, household size. CRM, registration forms. Demographic pyramid, faceted bars.
Geographic Region, urban/rural, climate, store catchment. Address fields, GPS, store hierarchy. Choropleth, hexbin, store-catchment maps.
Psychographic Lifestyle, attitudes, values, interests. Surveys, social listening, panel research. Radar charts, parallel coordinates.
Behavioural Purchase frequency, recency, basket, channel mix. Transaction logs, web and app analytics. RFM heatmaps, cohort retention curves.
Value-based Customer lifetime value, profitability tier. Finance and CRM joined. Pareto or decile-value charts.
TipRFM: the segmentation every BI analyst should know

Recency, Frequency, Monetary value (RFM) is the most durable behavioural segmentation in retail and e-commerce. It needs three columns from any transaction system: customer ID, transaction date, transaction amount. From those, three scores are computed — usually 1 to 5 quintiles — and combined into a 555 grid.

flowchart LR
  A[Transaction log<br/>CustomerID, Date, Amount] --> B[Compute Recency<br/>Today − last purchase]
  A --> C[Compute Frequency<br/>Count of purchases]
  A --> D[Compute Monetary<br/>Sum of amount]
  B --> E[Quintile 1-5]
  C --> E
  D --> E
  E --> F[RFM cell<br/>e.g. 555 = Champions<br/>111 = Lost]
  F --> G[Marketing action<br/>per cell]
  style A fill:#E8F0FE,stroke:#1A73E8
  style F fill:#FFF7E6,stroke:#F4B400
  style G fill:#E6F4EA,stroke:#137333

The RFM grid is naturally a heatmap. Cell colour shows segment size; tooltip shows revenue contribution; click jumps to the customer list.

TipK-means and other behavioural clustering

When the marketing team wants segments richer than RFM — including category mix, channel preference, or response history — clustering algorithms like k-means group customers in a feature space the analyst defines. Power BI Desktop has a clustering visual built on the same idea; Tableau exposes k-means under Analysis → Cluster; Excel does it through Power Query plus a small Python or R script. The visualisation lens for cluster output is almost always a parallel-coordinates or radar chart that shows how each cluster differs across the input variables, plus a labelled scatter where dimensionality is reduced to two principal components.

WarningSegmentation that managers do not use

Michel Wedel & Wagner A. Kamakura (2000) warn that statistically clean segmentations often fail managerially because the segments are not identifiable in the systems the marketing team actually uses, not sizeable enough to act on, or not responsive to the levers the team controls. Test every segment against four questions: can the team find members in the CRM, count them, reach them, and measure whether the message worked? If any answer is no, the segmentation is decorative.

49.3 Campaign Measurement: Pre-Post, Funnel, and Lift

A campaign is any time-bounded marketing intervention — a TV burst, a discount weekend, an email blast, an influencer drop. Campaign measurement asks: did sales, traffic, sign-ups, or some other target metric move because of the campaign, by enough, for long enough?

TipThe pre-post comparison and its hazards

The simplest measurement is a pre-post chart: the target metric for N weeks before the campaign, N weeks during, and N weeks after. A vertical reference line marks the campaign window. The visualisation gets two annotations: baseline average and campaign average, with the lift labelled in the title.

This is the right starting view for almost every campaign post-mortem, but it has two well-known traps. First, it cannot separate the campaign effect from a trend the metric was already on — a Diwali spike would have happened with or without the email. Second, it cannot separate the effect from seasonality or competitor activity. A more defensible measure compares test and control groups: an audience that received the campaign against a matched audience that did not.

flowchart TB
  A[Random or matched split] --> B[Test group<br/>Receives campaign]
  A --> C[Control group<br/>Matched, no campaign]
  B --> D[Measure target metric<br/>Test mean]
  C --> E[Measure target metric<br/>Control mean]
  D --> F[Lift = Test − Control<br/>Statistical test]
  E --> F
  style F fill:#E6F4EA,stroke:#137333

TipThe conversion funnel

For digital campaigns, the funnel is the workhorse visualisation: impressions → clicks → page views → add-to-cart → purchase. The bar widths shrink at each step. The view answers two questions: where in the funnel are we losing people? and did the campaign move the right step? A campaign that increases impressions by 40 percent but does not improve the impression-to-click rate is a reach campaign, not a persuasion campaign — and the dashboard should make that distinction visible.

In Power BI, build the funnel with the native Funnel chart visual or with a stacked-bar trick. In Tableau, a manual bar chart with sorted steps and percentage drop-off labels tends to read more cleanly than the marketplace funnel extensions. In Excel, the Funnel chart type added in 2019 is sufficient for ad-hoc analysis.

TipSix Campaign Metrics Every BI Analyst Is Asked About
Metric Formula What it tells you
ROAS Revenue from campaign / Ad spend Top-line efficiency of paid media.
CAC Total marketing spend / New customers acquired Loaded cost to win one new customer.
CPA Spend / Conversions (action-specific) Cost to drive one conversion.
CTR Clicks / Impressions Creative and targeting quality.
CPM Spend / (Impressions / 1000) Reach efficiency at the auction level.
ROI (Profit from campaign − Spend) / Spend Profit-aware version of ROAS.

A common dashboard error is to stop at ROAS without netting variable cost. ROAS of 4 looks heroic until margin is 30 percent, at which point the actual return on ad spend is 1.2. Wherever possible, build campaign dashboards with both revenue and gross profit visible side by side.

49.4 Multi-Touch Attribution: Who Gets the Credit?

A buyer sees a Facebook ad on Monday, searches on Google on Wednesday, clicks an email on Friday, and buys on Saturday. Which touchpoint deserves the credit? Attribution models answer that question, and they answer it differently. P. K. Kannan & Hongshuang “Alice” Li (2017) show that the choice of attribution model can shift the apparent value of a channel by more than 50 percent in either direction, so the model is not a technical detail — it is a budgeting decision.

TipSix Attribution Models, Each With a Built-In Bias
Model Logic Bias
Last click 100% credit to the last touch before conversion. Underweights upper-funnel awareness.
First click 100% credit to the first touch. Underweights closing channels.
Linear Equal credit across all touches. Smooths real differences away.
Time decay More credit to touches closer to conversion. Underweights early discovery.
Position-based (U-shaped) 40% first, 40% last, 20% spread across middle. Heuristic; not learned from data.
Data-driven (Markov / Shapley) Probabilistic credit using removal-effect or game-theory weights. Best, but needs touch-level data and tooling.

The visualisation that makes attribution legible is a small-multiples bar chart — one chart per channel, six bars per chart (one per model), with the y-axis showing the channel’s share of conversion credit. When the bars vary wildly, the audience sees the model risk in seconds.

TipSankey for the customer journey

The Sankey diagram is the canonical journey visualisation. Each node is a touchpoint type; each link is a transition; link width is the count of customers who took that path. A typical e-commerce Sankey has columns for first touch, middle touch, and converting touch, with links flowing left to right. Power BI offers a Sankey through the AppSource marketplace; Tableau builds it natively with parameters and dual-axis tricks (or the Sankey extension by Olivier Catherin).

WarningCap the journey at three or four touches

Real customer journeys can have 12 or more touches and the Sankey turns into a hairball. Group everything beyond the third touch into an ‘other’ node. The audience needs to see the dominant patterns, not every edge case.

49.5 Common Pitfalls

CautionWhat goes wrong
  1. Vanity metrics on the front page. Impressions and reach without conversion or revenue. Senior audiences smell this immediately.
  2. Last-click as default. Most ad platforms default to last-click, which is the model that makes the platform itself look best. Always show at least two models side by side.
  3. No control group. Pre-post charts presented as causal evidence. Without a control, the chart is a description, not a measurement.
  4. Segmentation with too many bases. Combining demographic, geographic, and behavioural variables into one cluster solution often produces segments nobody can act on. Stack segmentations instead — first by behaviour, then describe demographics within each behavioural cluster.
  5. Funnel without time. A funnel is a snapshot; the same funnel a quarter later may be different. Always pair the funnel with a small trendline of the bottom-of-funnel rate.
  6. ROAS without margin. A 4x ROAS on a 25 percent margin product is not a green dashboard.
  7. Attribution without journey caps. Customers with 50 touches dominate the Sankey and bury the typical journey.
  8. Average-spend reporting. Mean order value across all customers hides everything; medians plus deciles reveal more, and the dashboard should default to the more honest view.
  9. Channel silos. Email, paid search, and display dashboards owned by separate teams using different definitions of conversion. Reconcile to a single conversion definition before any cross-channel chart is built.
  10. Personally identifiable customer data on dashboards seen by too many people. Marketing dashboards often join CRM data; row-level security is mandatory, not optional.

49.6 Illustrative Cases

NoteThree case sketches

Yuvijen Stores RFM-driven email programme. Marketing team builds an RFM segmentation in Power BI on three years of loyalty-card transactions. Champions (5-5-5) get an early-access invitation; At-Risk (2-1-3) get a winback offer; Lost (1-1-1) are excluded from spend. The campaign dashboard shows revenue per email by RFM cell. Within two cycles, At-Risk re-engagement rates climb from 4 to 11 percent and the team retires a blanket-discount calendar that had been running for six years.

Yuvijen Telecom prepaid recharge campaign. Telecom analytics team wants to measure a recharge-bonus campaign run on a subset of circles. Instead of reporting headline pre-post lift, they build a Tableau dashboard with matched control circles selected by ARPU and churn similarity. The lift narrows from a headline 14 percent to a defensible 6.2 percent. The CFO accepts the smaller, defensible number and approves a national rollout — the previous approach had been blocked for two quarters because the numbers seemed too good.

Yuvijen Forge Components Ltd. trade-show attribution. B2B analytics team in a manufacturing firm uses a Power BI Sankey to map the journey from trade-show lead to closed deal. The Sankey reveals that 38 percent of closed deals had a post-show webinar touch that the trade-show team was not crediting. Trade-show ROAS, recomputed under a position-based model, rises from 1.1 to 2.4. The webinar team gets a budget increase the trade-show team had been blocking.

49.7 Hands-On Exercise: Build a Marketing Analytics Dashboard

NoteThree-page marketing dashboard

Aim. Build a three-page marketing-analytics dashboard in Power BI that answers the segmentation, campaign, and attribution questions on a single dataset. The same exercise can be done in Tableau; both routes are described.

Scenario. You are the marketing analytics lead at Yuvijen Stores. The CMO has asked for a dashboard that lets her see who the most valuable customers are, which of last quarter’s campaigns earned its money, and which channels are getting credit. You have transaction data, campaign metadata, and a touch-level digital log.

Deliverable. A Power BI report with three pages — Segmentation, Campaigns, Attribution — sharing a date filter and a region filter, with row-level security so that regional managers see only their own data.

49.7.1 Step 1 — Prepare the dataset

Open Power BI Desktop. Use Get Data to load three CSVs from the workshop pack:

  • transactions.csv — CustomerID, Date, Amount, Category, Channel, Region.
  • campaigns.csv — CampaignID, Name, StartDate, EndDate, Channel, Spend.
  • touches.csv — CustomerID, Touch1, Touch2, Touch3, ConversionFlag, Date.

In Power Query, ensure date columns are typed as Date, amounts as Decimal Number. Build a DimDate calendar table with CALENDARAUTO() in DAX. Mark it as the date table.

49.7.2 Step 2 — Page 1: Segmentation (RFM)

Create three DAX measures on the transactions table:

Recency =
DATEDIFF(
    MAX(transactions[Date]),
    TODAY(),
    DAY
)

Frequency =
DISTINCTCOUNT(transactions[TransactionID])

Monetary =
SUM(transactions[Amount])

Build a calculated column for each customer that rolls these up at the customer level, then bin each into quintiles using RANKX and integer division. Concatenate the three digits into an RFMCell column.

On the page, drop:

  • A matrix visual with Recency quintile on rows, Frequency quintile on columns, and Monetary sum as values, conditionally formatted as a heatmap. This is the 5×5 RFM grid.
  • A donut or treemap of customers by named segment (Champions, Loyal, At-Risk, Hibernating, Lost) using a calculated label column derived from the RFM cell.
  • A table of the top 100 Champion customers with CustomerID hashed for privacy.

Tableau alternative: build the three quintile fields as calculated fields, drop them on Rows/Columns of a heatmap, and use a calculated Segment dimension for colour.

49.7.3 Step 3 — Page 2: Campaign measurement

Build two visuals:

  • Pre-post line chart. Daily revenue with a vertical reference line at the campaign start date and another at the campaign end date. Annotate the chart title with the lift percentage, computed as a DAX measure: (CampaignAvg - PreAvg) / PreAvg.
  • Funnel. Use a calculated table to roll up impressions, clicks, add-to-carts, and purchases for the campaign window. Drop the Funnel visual.

Add a slicer for Campaign Name that affects both visuals. Add card visuals for ROAS, CPA, and CAC.

Tableau alternative: a dual-axis line chart with reference lines marks pre-post; a sorted bar chart with percentage labels stands in for the funnel.

49.7.4 Step 4 — Page 3: Attribution

Build a stacked bar chart, one row per channel (Search, Social, Email, Display, Direct, Affiliate), with stacked segments showing the share of credit under three models — Last Click, Linear, and Position-Based. The DAX needs three measures, one per model, computed against the touch-level table.

Add a Sankey visual (install from AppSource if not already in the report) showing the dominant first-touch → second-touch → conversion paths, capped at the top 10 paths. Filter to the selected campaign window.

Tableau alternative: build the small-multiples bar chart with the channel dimension on Rows and three measures on Columns; use the Sankey extension by Olivier Catherin for the journey view.

49.7.5 Step 5 — Cross-page filters and security

In Power BI, use the Sync slicers pane so that a single date slicer and a region slicer apply across all three pages. Set up Row-Level Security: create a RegionSecurity table, define a DAX role RegionalManager with [Region] = USERNAME(), and test by viewing as different users.

49.7.6 Step 6 — Story-driven titles

Replace each visual title with the takeaway, not the data:

  • Not ‘Customers by RFM Segment’ but ‘21 percent of customers are Champions and drove 64 percent of FY26 revenue.’
  • Not ‘Daily Revenue Pre and Post Campaign’ but ‘Diwali email lifted daily revenue by 18 percent for 11 days.’
  • Not ‘Channel Credit by Model’ but ‘Display gets 28 percent under last click and 12 percent under data-driven — budget at risk.’

This connects the dashboard to the storytelling discipline of Chapter 48.

49.7.7 Step 7 — Publish and add data alerts

Publish to a Power BI workspace. Configure two data-driven alerts: one when weekly campaign ROAS drops below 2.0, and one when the Champion-segment count drops by more than 5 percent week over week. The alerts go to the marketing director on email and the Power BI mobile app — connecting back to Chapter 47.

TipConnect to the Visualisation Layer

Marketing analytics is where almost every visualisation idiom in this book earns its keep. Heatmaps from Chapter 12 visualise RFM. Funnels and reference lines from Chapter 12 measure campaigns. Sankey diagrams sit at the boundary of flow visualisation and network visualisation. Choropleths localise campaign lift by region. Colour rules from Chapter 13 keep the dashboards readable when they fan out across channels. The accessibility checks of Chapter 14 keep the dashboards usable for the colour-blind colleague reviewing email creative. The mobile design of Chapter 47 means the CMO sees the same RFM heatmap on a phone in a taxi as on the boardroom screen. Marketing analytics is the application of the visualisation grammar to the function that has the loudest voice in most boardrooms.

TipFiles and Screen Recordings

Power BI report with three pages and RLS (yuvijen-stores-marketing.pbix), Tableau equivalent (yuvijen-stores-marketing.twbx), workshop dataset (yuvijen-stores-marketing-data.xlsx), and a screen recording of the dashboard tour (yuvijen-stores-marketing-walkthrough.mp4) will be embedded here.

Summary

Concept Description
Three Marketing Questions
Who Is the Customer? Segmentation dashboard answers who the customer is
Did the Campaign Work? Campaign dashboard answers whether the intervention worked
Which Channel Gets Credit? Attribution dashboard answers which channel deserves the credit
Three Dashboards, Not One Build separate dashboards per question rather than one mega-dashboard
Segmentation Bases
Demographic Segmentation Age, gender, income, household size from CRM data
Geographic Segmentation Region, urban or rural, store catchment from address fields
Psychographic Segmentation Lifestyle, attitudes, values from surveys and panel research
Behavioural Segmentation Purchase frequency, recency, basket from transaction logs
Value-Based Segmentation Customer lifetime value and profitability tier from joined finance and CRM
Behaviour over Demography Behavioural variables predict action; demographic ones only describe
RFM
Recency, Frequency, Monetary Three behavioural scores derived from any transaction system
RFM Quintile Cell Quintile each score and concatenate into a three-digit cell label
Champions and Lost 555 cell is Champions, 111 is Lost — extremes of the matrix
RFM Heatmap Standard rendering is a 5x5 heatmap with size and revenue in tooltip
RFM-Driven Programmes Cell-level rules drive email, retention, winback campaigns
Behavioural Clustering
K-Means in BI Tools Power BI clustering visual, Tableau Analysis menu, Excel via Python or R
Parallel-Coordinates or Radar Show how clusters differ across input variables in a single chart
Segment Test Criteria Identifiable, sizeable, reachable, responsive — all four required
Campaign Measurement
Pre-Post with Reference Line Daily metric with vertical line at campaign start, baseline annotation
Test versus Control Matched control group separates campaign effect from trend and seasonality
Conversion Funnel Impressions to clicks to conversions; reveals the leak
Campaign Metric Stack ROAS, CAC, CPA, CTR, CPM, ROI — six metrics every dashboard answers
Revenue with Gross Profit Show top-line revenue and margin-aware gross profit side by side
Attribution Models
Last Click 100 percent credit to the last touch — underweights upper funnel
First Click 100 percent credit to the first touch — underweights closing channels
Linear Attribution Equal credit across all touches — smooths real differences away
Time Decay More credit to touches closer to conversion
Position-Based 40 percent first, 40 percent last, 20 percent middle
Data-Driven Attribution Markov removal-effect or Shapley-value probabilistic credit
Model Sensitivity Model choice can shift channel share by 50 percent or more
Customer Journey Visualisation
Sankey Touch Sequences Each link is a transition; width is customer count
Touch Cap Cap at three or four touches to keep the diagram readable
Long-Tail Bucketing Group long tails of touches into a single other node
Sankey in Power BI and Tableau Power BI marketplace Sankey or Tableau Catherin extension
Common Pitfalls
Pitfall: Vanity Metrics Impressions and reach without conversion or revenue
Pitfall: Last-Click Default Most ad platforms default to last click — show two models side by side
Pitfall: No Control Group Pre-post without a matched control is descriptive, not causal
Pitfall: Too Many Bases Combining demographic, geographic, behavioural in one cluster solution
Pitfall: ROAS Without Margin ROAS of 4 looks heroic until margin is 25 percent — show both
Pitfall: Channel Silos Email, paid search, and display teams using different conversion definitions
Pitfall: PII Without RLS Marketing dashboards often join CRM — RLS and audit logs are mandatory
Hands-On Dashboard
Page 1 — Segmentation RFM matrix and named-segment treemap with hashed customer table
Page 2 — Campaign Pre-post chart and conversion funnel with ROAS card
Page 3 — Attribution Stacked bar by channel by model, plus Sankey of journey
Synced Slicers Date and region filters synchronise across pages
Row-Level Security Regional managers see only their own region
Story-Driven Titles Replace data titles with takeaway titles
Data-Driven Alerts Alerts on weekly ROAS below 2 and Champion drop above 5 percent