Marketing team
Paid campaigns for a meal-kit app: daily spend and clicks per campaign, the sign-ups each campaign brought in, and what those users bought. January to June 2025.
campaigns
One row per campaign. Key: campaign_id. 10 rows in the larger version, 6 in the smaller.
| campaign_id | int | Unique id. |
| campaign_name | text | Name. |
| channel | text | search, social, video, email or affiliate. |
| started_on | date | First day live. |
| ended_on | date, nullable | Last day live. NULL if still running. |
| daily_budget | numeric(10,2) | Budget per day, USD. |
ad_daily
One row per campaign per day it served ads. Days with no delivery have no row. Key: campaign_id, day. 969 rows in the larger version, 588 in the smaller.
| campaign_id | int | The campaign. |
| day | date | The day. |
| impressions | int | Times an ad was shown. |
| clicks | int | Clicks. |
| spend | numeric(10,2) | Money spent, USD. |
signups
One row per new user. campaign_id is the campaign credited with the sign-up. Key: user_id. 2,108 rows in the larger version, 850 in the smaller.
| user_id | int | Unique id. |
| signed_up_at | timestamp | When they signed up (UTC). |
| campaign_id | int, nullable | Credited campaign. NULL for organic sign-ups. |
| country | text | Two-letter country code. |
purchases
One row per paid order by a user. Key: purchase_id. 2,294 rows in the larger version, 878 in the smaller.
| purchase_id | int | Unique id. |
| user_id | int | Buyer. |
| purchased_at | timestamp | When (UTC). |
| amount | numeric(10,2) | Order value, USD. |
Questions on this database
- April spend and cost per click for search and socialThe paid team reviews campaigns on the search and social channels for April 2025 (from 2025-04-01 to 2025-04-30 inclusive, by ad_daily.day).
- Sign-ups per campaign who placed a large orderMarketing wants to know which campaigns bring in big spenders.
- Organic sign-ups during each campaign's runThe growth team wants a rough sense of the background sign-up rate while each campaign ran. A campaign was live from started_on to ended_on, both days included.
- Daily spend against sign-ups for one campaignThe growth team is reconciling two sources for the "Family meals video" campaign (campaign_id = 3) in May 2025: the ad platform's daily spend (ad_daily)...
- Spend and sign-ups per campaign from two sourcesThe marketing report builds one row per campaign from two separate sources: total spend from ad_daily, and the number of sign-ups credited to the campaign...
- Average first purchase value by campaign, organic includedThe growth team wants to compare how much users spend on their first order, by where they came from.
- Two cheapest campaigns per month by cost per clickThe marketing team wants to see which campaigns bought clicks most cheaply each month.
- Cumulative revenue by day, including quiet daysThe finance team plots cumulative purchase revenue for June 2025. The chart needs one point for every calendar day, even a day with no purchases.
- June purchases compared with the first purchaseThe lifecycle team wants to see how a customer's big June orders compare with the very first order they ever placed.
- Record click days with a running maximumThe paid-media team celebrates each campaign's best day so far. For every campaign, track its high-water mark of daily clicks during June 2025.
- Rolling seven-day spend when days are missingA pacing report shows, for campaign 1, how much it spent over the last 7 calendar days. A campaign that did not serve ads on a day has no row for that day.
- Seven-day moving average of sign-upsThe growth team charts daily sign-ups with a 7-day moving average. Build the June 2025 numbers.
- Campaigns cheaper per sign-up than their channelMarketing wants to know which campaigns beat the rest of their channel on cost per sign-up.
- Cost per click, with zero-click campaignsFinance wants the cost per click (CPC) of every campaign: all the money it spent divided by all the clicks it got, in US dollars.
- Click-through rate by campaignThe marketing team reports the click-through rate (CTR) of each campaign: all the clicks it received divided by all the impressions it served, over every...
- Sign-up to purchase conversion by campaignThe growth team judges each campaign by how many of its sign-ups ever bought something.
- Seven-day buyer rate by campaignMarketing judges each campaign by how many of its sign-ups buy within a week.
- Monthly cost per click by channelThe marketing team compares how much a click costs on each channel, month by month, for January to June 2025.
- Live campaign days with no deliveryAd ops suspects some campaigns stopped serving on days they were supposed to be live.
- Number campaigns by end date, running ones lastThe campaign dashboard lists campaigns by how recently they ended. Number the campaigns 1, 2, 3, ...
- Channel share of ad spend, Q1 against Q2Marketing wants to see how the mix of ad spend moved between the first two quarters of 2025.
- Monthly buyers and growth, with gap monthsThe growth team charts how many different users buy each month and how that changes.
- Campaigns that never brought in a paying userA campaign brings in a user when the user's sign-up is credited to it (signups.campaign_id). Sign-ups with no campaign are organic.
- Sign-ups who never bought, by sign-up monthGrowth wants to know how many sign-ups never turned into a customer, month by month.
- Weekly sign-up cohorts and next-week buyersThe marketing team tracks whether new sign-ups come back to buy. Group users into weekly cohorts and measure repeat buying in the following week.
- Ad funnel from impressions to buyers by channelMarketing wants one funnel per channel for the whole period: impressions, clicks, sign-ups and buyers.
- Longest run of delivery days per campaignCampaign managers want to know the longest uninterrupted stretch each campaign served ads.
- Grain check for a user by day purchase modelAn analytics model fct_user_day is meant to have one row per user per calendar day (UTC), built from purchases.
- Campaign by day fact table with cumulative spendMarketing wants a daily table at the grain one row per campaign per day it was live, for 2025-03-10 to 2025-03-16 inclusive.