SocialCode CI Analyst Ad-Campaign Dataset Exercise
Clean, parse and join two raw ad-campaign datasets, then build roll-up tables for spend, impressions, engagement and cost per video view by age group, targeting cluster and device.
Overview
You are provided with two raw ad-campaign input datasets. Your task is to clean, join, and aggregate these datasets to produce a set of summary roll-up tables covering spend, impressions, engagement actions, and cost-per-video-view (CPVV) metrics: broken out by the campaign dimensions encoded in the campaign name.
Data
You are given two CSV files:
CI_Analyst_-_input1.csv Contains campaign-level spend and delivery metrics. Columns:
campaign_name: encodes age group, targeting cluster, device/product, and an optional date suffixspend: media spend in USDimpressions: number of impressions servedclicks: number of clicks recorded
CI_Analyst_-_input2.csv Contains campaign-level engagement and content-type data. Columns:
campaign_name: same campaign identity as input1, but token order within the name variesactions: a Python-style list of engagement action objects (single-quoted, so not strict JSON); each object hasaction_type(one of:like,comment,share,video_view) andvalueobject_type: content format, eitherVIDEOorLPP
Campaign Name Structure
Each campaign name encodes the following dimensions (tokens may appear in varying order across the two files):
| Dimension | Example Values |
|---|---|
| Age group | <21, 21-30, 31-40, 41-50, 51+ |
| Targeting cluster | allclusters, cluster1, cluster2, cluster3, notarget |
| Device / product | htc_one_1GB, htc_one_2GB, htc_one_2GB_limited_time_offer, iphone5S, iphone_6/6+_Vzn, iphone_6/6+_AT&T, iPhone_6/6+_all_other_devices, nokia_lumia_v3, nokia_lumia_v3_MORE_EVERYTHING, nokia_lumia_v3_more_everything |
| Date suffix (optional) | 8114, 9114, 10114 |
Tasks
-
Parse and normalize the campaign names in both files to extract the structured dimensions (age group, targeting cluster, device/product). Handle case inconsistencies and token-order variation as you judge appropriate.
-
Join the two datasets on campaign identity (using the parsed dimensions) to create a unified campaign-level table.
-
Parse the
actionsfield in input2 to extract counts for each action type (like,comment,share,video_view) per campaign. -
Produce roll-up summary tables aggregating the following metrics, grouped by the dimensions you judge appropriate (e.g., age group, targeting cluster, device/product, or combinations thereof):
- Total spend (USD)
- Total impressions
- Total engagement actions (by action type and/or combined)
- CPVV (cost per video view): total spend divided by total video views, for VIDEO object-type campaigns
-
Identify and discuss any data quality issues you encounter (e.g., duplicate entries, unmatched records between the two files, case or naming inconsistencies) and describe how you addressed them.
-
Summarize your findings in a brief written commentary interpreting the roll-up tables: for example, which segments, clusters, or devices show notably higher or lower spend efficiency or engagement.
Deliverable
Submit a single PDF file containing:
- All code used to load, clean, join, and aggregate the data (the code must be complete and executable so that all outputs can be regenerated)
- All summary roll-up tables
- All supporting charts or visualizations you choose to include
- Your written discussion of data quality issues and findings