Instagram Story Ad Swipe-Up to Purchase Within the Same Session
Last updated: November 29, 2026
Quick Overview
Given sessionized Instagram events, compute for each Story ad campaign the share of impression sessions that had a swipe-up and the share of swipe-up sessions that ended in a purchase later in the same session.
Meta
November 29, 20260
0
0 solved
Given sessionized Instagram events, compute for each Story ad campaign the share of impression sessions that had a swipe-up and the share of swipe-up sessions that ended in a purchase later in the same session.
A session-scoped ads funnel in the style of Meta's onsite SQL rounds for ads data science. The interviewer checks ordering within a session (purchase after swipe-up), the session as the funnel unit, and that impressions without a swipe stay in the denominator.
What the Interviewer Expects
- Uses the session as the funnel unit
- Requires the purchase to follow the first swipe-up in that session
- Computes impression to swipe and swipe to purchase rates per campaign
- Aggregates with MIN timestamps per step to avoid fan-out
- Explains what in-session conversion misses
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 purchases that happen in a later session within seven days?
- Why might in-app browser purchases be under-logged?
- How would you compare Story ads to Reels ads fairly with this metric?
- What would you do with sessions where the same campaign served three impressions?
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
ig_session_events(session_id, user_id, campaign_id, event_name, event_ts) with story_ad_impression, swipe_up, and purchase (from the in-app browser pixel, already tagged with the campaign). Th...
Approach
Aggregate once per (session, campaign) with conditional MIN timestamps for each step. Then evaluate ordering with simple comparisons and aggregate by campaign. One pass avoids self-joins and fan-out...