Marketing & Conversion Analytics Report Generator

Multi-table SQL-style simulation with ROI, funnel, cohort, and LTV reporting

1. Marketing ROI Analysis

Campaign-level visitors, conversions, revenue, budget, and ROI. The simulation follows the requested multi-table join pattern: campaigns are associated with visitor sessions by active date, then conversions are joined by visitor. Budgets are prorated for partial selected date ranges.

SQL Query

        

2. Funnel Conversion Rates

Source-level funnel performance. Conversion counts are deduplicated by conversion_id to avoid SQL fan-out from multiple joins, producing clean signup and purchase counts.

SQL Query

        

3. Cohort Analysis

Monthly cohort performance. The requested query aggregates by cohort month. The heatmap extends the cohort view by source so conversion quality can be compared across acquisition channels.

SQL Query

        
Heatmap Extension Query

        

4. Customer Lifetime Value by Source

Purchase-based value by acquisition source. The requested SQL template is shown below. The report table also includes a corrected lifetime value metric: total purchase revenue divided by unique purchasing customers, avoiding the repeat-purchase denominator issue.

SQL Query