This project analyzes marketing spend and returns across multiple advertising channels to determine which platforms deliver the best ROI — directly relevant to Samantus's own digital marketing agency work.
C10.2 Business Problem
A marketing team is spreading budget across 5 channels and wants data-backed clarity on which channels actually deliver the best return, to reallocate spend more effectively.
C10.3 Dataset Description
Column
Description
channel
Marketing channel (Instagram, Google Ads, etc.)
spend
Amount spent on the campaign (Rs.)
conversions
Number of conversions (sales/leads) generated
revenue
Revenue generated from the campaign
Sample scope: 10 campaigns across 5 channels over one quarter.
C10.4 Objectives
Calculate ROI for each marketing channel
Analyze the relationship between ad spend and conversions
Identify the best and worst performing channels
Recommend a revised budget allocation strategy
C10.5 Step-by-Step Solution
Step 1: Load the campaign performance CSV into Pandas
Step 2: Calculate ROI % for each campaign: (revenue - spend) / spend * 100
Step 3: Calculate average ROI per channel
Step 4: Visualize spend vs conversions using a scatter plot
import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv("campaign_data.csv")
df['roi_pct'] = (df['revenue'] - df['spend']) / df['spend'] * 100
channel_roi = df.groupby('channel')['roi_pct'].mean().sort_values(ascending=False)
print("Average ROI % by Channel:\n", channel_roi.round(1))
best_channel = channel_roi.idxmax()
worst_channel = channel_roi.idxmin()
print("Best Channel:", best_channel)
print("Worst Channel:", worst_channel)
plt.scatter(df["spend"], df["conversions"])
plt.title("Spend vs Conversions")
plt.savefig("spend_scatter.png")
C10.7 Expected Output
Output
Best Channel: Instagram Worst Channel: Facebook
C10.8 Visualizations
Figure C10.1 — Average ROI % by marketing channel.Figure C10.2 — Relationship between ad spend and conversions.
C10.9 Key Insights
Instagram delivers the highest average ROI (185%), meaningfully ahead of Google Ads (110%) and Facebook (95%, the weakest performer).
Spend and conversions show a strong, roughly linear positive relationship — suggesting the channels analyzed aren't yet hitting diminishing returns at current budget levels.
Email marketing (140% ROI) punches well above its typical budget share, suggesting it's currently under-invested relative to its efficiency.
C10.10 Business Recommendations
Shift 15-20% of Facebook's current budget toward Instagram and Email, based on their clearly superior ROI performance.
Since spend and conversions haven't plateaued, consider testing a modest overall budget increase on the top 2 channels to capture more scale before returns diminish.
Re-run this exact ROI analysis quarterly to catch channel performance shifts early, rather than relying on outdated assumptions about which platforms work best.
✓ Instructor Tip
This project connects directly to real agency work — encourage students running their own digital marketing services to adapt this exact script for client reporting.