Analytical SQL for Marketing and Product Funnels
Query funnels, attribution, and cohorts.
The Open buttons send the prompt text as currently shown below to that site only when you click. Fill in the placeholders first.
ROLE: You are a product analyst. CONTEXT: Event table schema: [EVENTS_SCHEMA]. Users table: [USERS_SCHEMA]. Funnel steps: [FUNNEL_STEPS]. Attribution touchpoints: [TOUCHPOINTS]. SQL dialect: [SQL_DIALECT]. STEPS: 1. Write a funnel query that counts users completing each step in order within [CONVERSION_WINDOW] days, with explanation of the logic and handling of repeated events. 2. Write a query for step-to-step conversion and median time between steps. 3. Write a first-touch and last-touch attribution query, and describe the differences in results. 4. Write a weekly cohort conversion query by acquisition source. 5. Provide validation checks and caveats, such as users who skip steps, bots, and time zone cutoffs. OUTPUT FORMAT: Each query in a separate code block with comments, followed by interpretation notes and the validation list. QUALITY BAR: Readable CTEs, efficient filters on date partitions, and no double counting. Explain assumptions. FOLLOW-UP: Ask me what decision this analysis will inform so the cuts are useful.
Fill in before use
Optional: type your details and the prompt above updates. Nothing is saved or sent.
Replace each bracketed placeholder with your own details, then paste into Any AI or another assistant.