← Back to portfolio

Digital Marketing Campaign Performance

Python · Pandas · Matplotlib · Self-directed · Data: Predict Conversion in Digital Marketing Campaign by Rabie El Kharoua, via Kaggle — CC BY 4.0

Brief

A public 8,000-customer campaign dataset — spend, click-through rate, a conversion-rate field, and a converted/didn't-convert outcome, split across five channels (PPC, SEO, Social Media, Email, Referral) and four campaign types. It's a practice dataset rather than a live ad account export, so this reads as a directional exercise in the same questions a real account review asks: does channel or campaign type actually move conversion, and if not those, what does?

Customers
8,000
5 channels, 4 campaign types
Total ad spend
$40.0M
avg $5,001 / customer
Conversion rate
87.7%
across the whole dataset
Avg. CTR
15.5%
click-through rate

Cleaning

QA pass across all 20 columns: df.isna().sum() returned zero missing values, and zero duplicate CustomerID rows. Two columns — AdvertisingPlatform and AdvertisingTool — turned out to hold a single placeholder value across every one of the 8,000 rows ("IsConfid" and "ToolConfid" respectively — redacted rather than genuinely captured), so they were dropped before analysis rather than treated as real signal. The categorical fields checked out cleanly: Gender splits 4,839 Female / 3,161 Male, the five CampaignChannel values and four CampaignType values are each represented in the low-to-mid thousands with no rare or malformed categories, and every numeric field's observed range matched what you'd expect (age 18–69, income $20,014–$149,986) with no negative values or impossible outliers.

Data profile

Descriptive statistics for the demographic, spend and engagement fields used below.

FieldMinMeanMedianMaxStd dev
Age1843.6436914.9
Income ($)20,01484,66484,927149,98637,580
AdSpend ($)1005,0015,0139,9982,838
ClickThroughRate0.010.1550.1550.300.084
ConversionRate0.010.1040.1040.200.055
WebsiteVisits024.8254914.3
PagesPerVisit1.05.55.510.02.6
TimeOnSite (min)0.57.77.715.04.2
SocialShares049.8509928.9
EmailOpens09.59195.7
EmailClicks04.5492.9
PreviousPurchases04.5492.9
LoyaltyPoints02,4902,4974,9991,430

Channel performance

Across the five channels, conversion rate barely moves — everything sits between 86.8% and 88.3%, and spend-per-conversion is just as tight, between $5,612 and $5,809. PPC — the closest analog here to Google-Ads-style paid search — lands right in the middle of the pack on both measures, not a standout in either direction.

Bar charts of conversion rate and spend per conversion across five marketing channels, all within a narrow range
Fig 1. — Conversion rate and spend-per-conversion by channel. The dashed line marks the dataset-wide average — every channel sits close to it.

Campaign type is where the real gap is

Campaign type tells a clearer story than channel does. Bottom-of-funnel "Conversion"-type campaigns convert at 93.4%, well above Awareness, Consideration and Retention campaigns, which all sit around 85.6–85.8%. That's the one genuinely sizeable gap anywhere in this dataset.

Bar chart of conversion rate by campaign type, with Conversion-type campaigns notably higher than Awareness, Consideration and Retention
Fig 2. — Conversion-type campaigns outperform every other campaign type by roughly 8 points.

What actually correlates with conversion?

Running every numeric field against the actual conversion outcome, nothing comes close to a strong relationship — the top correlation is only 0.13. Age, income and social shares are essentially unrelated to conversion (all under 0.02, one slightly negative). What little signal exists sits with on-site and email engagement, spend, and click-through rate — all real but modest.

Horizontal bar chart of correlation between each feature and actual conversion outcome, all values weak and under 0.13
Fig 3. — Nothing here is a strong predictor on its own — note the axis only runs to about 0.13. Demographics barely register.

Engagement, not demographics

Converted customers consistently show more engagement than those who didn't convert — more time on site, more email opens and clicks, more prior purchases — even though none of those gaps are dramatic on their own.

Four bar charts comparing time on site, email opens, email clicks and previous purchases between converted and non-converted customers, all higher for converted customers
Fig 4. — Converted customers run higher across every engagement measure checked — directionally consistent, even if each individual gap is modest.

A data-quality note

The dataset ships its own ConversionRate field (0–0.2, one per customer) as well as the actual converted/didn't-convert outcome — worth checking whether the two agree. They point the same direction (converted customers score higher: median 0.107 vs. 0.081) but overlap heavily, matching the same 0.09 correlation seen above. Combined with every numeric field in this dataset being close to uniformly distributed, that's consistent with this being a synthetically generated practice dataset rather than a real captured ad log — a reason to read the findings here as directional, not as a stand-in for a live account.

Box plot comparing the dataset's own ConversionRate field between customers who did and did not convert, showing heavy overlap with only a modest shift
Fig 5. — The dataset's own "ConversionRate" field shifts in the right direction for converted customers, but the overlap is substantial.

What this means