Month-Over-Month Retained Advertisers in Meta Ads Manager

Last updated: November 29, 2026

Quick Overview

Using a daily ad spend table, compute for each month the number of advertisers who spent, how many of them also spent in the following month, and the resulting month-over-month advertiser retention rate.

Meta
Data Manipulation (SQL/Python)
Data Scientist
Meta
November 29, 2026
Data Scientist
Phone Screen
Data Manipulation (SQL/Python)
Easy

0

0

0 solved


Using a daily ad spend table, compute for each month the number of advertisers who spent, how many of them also spent in the following month, and the resulting month-over-month advertiser retention rate.

Meta's ads business watches small and medium advertiser retention closely because churned advertisers are expensive to win back. This phone-screen question checks a simple self-join on a shifted month and correct handling of the last month, which has no next month yet.

What the Interviewer Expects
  • Aggregate to distinct advertiser-month pairs first
  • Join each month to the next month on advertiser
  • Keep advertisers without a next month in the denominator
  • Exclude the latest month from the rate
  • Treat zero or negative spend rows correctly
Key Topics to Cover
self-join
month truncation
advertiser retention
LEFT JOIN
incomplete period
How to Approach This
  1. Clarify the schema and expected output format before writing queries.
  2. Use CTEs (WITH clauses) to break complex queries into readable steps.
  3. Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
  4. Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
  5. For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
  • How would you add revenue retention alongside advertiser counts?
  • How would you split this by advertiser size tier?
  • What if an advertiser pauses for one month and comes back?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice SQL Problems
Sample Answer
Clarify the Data

ad_spend(advertiser_id, ds, spend_usd). An advertiser is active in a month if total spend in that month is greater than 0 (refund rows can be negative). Months are calendar months....

Approach

Build active_months with GROUP BY advertiser, month HAVING SUM(spend) > 0. LEFT JOIN it to itself where the right month equals the left month plus one. Count left rows and matched right rows per m...


Submit Your Answer
Markdown supported