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
November 29, 20260
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
How to Approach This
- Clarify the schema and expected output format before writing queries.
- Use CTEs (WITH clauses) to break complex queries into readable steps.
- Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
- Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
- 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 ProblemsSample 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...