Interview Query
~4 hrs
AnalyticsData Viz & InterpretationMarketingData Modeling

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.

Data AnalystBusiness AnalystMarketing Analyst
Updated 7 days agoReviewed byIQIQ Team

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 suffix
  • spend: media spend in USD
  • impressions: number of impressions served
  • clicks: 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 varies
  • actions: a Python-style list of engagement action objects (single-quoted, so not strict JSON); each object has action_type (one of: like, comment, share, video_view) and value
  • object_type: content format, either VIDEO or LPP

Campaign Name Structure

Each campaign name encodes the following dimensions (tokens may appear in varying order across the two files):

DimensionExample Values
Age group<21, 21-30, 31-40, 41-50, 51+
Targeting clusterallclusters, cluster1, cluster2, cluster3, notarget
Device / producthtc_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

  1. 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.

  2. Join the two datasets on campaign identity (using the parsed dimensions) to create a unified campaign-level table.

  3. Parse the actions field in input2 to extract counts for each action type (like, comment, share, video_view) per campaign.

  4. 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
  5. 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.

  6. 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
Download project files