Facebook Ads: Campaign & Audience Analysis
SQL Server. Tableau | Independent Project
Analyzed 1,143 Facebook ad records to compare campaign purchase volume and cost efficiency, examine audience differences, and assess how zero-spend records affect the results.
Key Findings
-
Purchase Volume versus Cost: Campaign 1178 generated 872 purchases, about 81% of the total, at a cost per purchase of 63.83. Campaign 916 cost 6.24 per purchase but generated only 24 purchases.
-
Audience Differences: Within campaign 1178, ads targeting men aged 30–34 recorded 243 purchases at a cost per purchase of 30.77, the lowest among its demographic segments.
-
Data Sensitivity: Excluding zero-spend ads increased overall cost per purchase from 54.41 to 58.53. Campaign cost ranking remained unchanged.
My Approach
-
Validate the data: Checked record counts, unique ad IDs, missing values, and metric consistency. Retained all 1,143 records.
-
Analyze performance in SQL: Compared campaigns and audience segments using total spend divided by total approved purchases.
-
Check sensitivity: Investigated zero-spend records and repeated campaign comparisons using only positive-spend ads.
-
Build the Tableau dashboard: Created KPI cards, campaign comparisons, and an audience view with filters for spend status and audience campaign.
SQL Analysis
Campaign Performance Comparison
Grouped ads by campaign to compare spending, approved purchases, and cost per purchase. Used NULLIF to prevent division by zero.


Campaign 916 had the lowest observed cost per purchase at 6.24, but generated only 24 approved purchases. Campaign 1178 generated the most purchases at 872, with a higher cost per purchase of 63.83. These results show a trade-off between purchase volume and cost efficiency. More testing is needed to see whether Campaign 916 could maintain its lower cost with increased spending.
Audience Analysis by Age and Gender
Compared age and gender groups within campaign 1178 to identify differences in purchase volume and cost per purchase.


Within campaign 1178, ads targeting men aged 30–34 recorded 243 approved purchases at a cost per purchase of 30.77, the highest purchase volume and lowest cost per purchase among its demographic segments. Ads targeting women aged 45–49 had the highest cost per purchase at 137.76, with 87 approved purchases.
Ad creative, interest targeting, and delivery may also differ across these groups, so the results alone do not show that age or gender caused the performance differences.
Zero Spend Sensitivity Check
Some ads recorded purchases despite having zero spend. I compared campaign results with and without these records to check whether they changed the cost rankings.


