This automation builds a production-grade Weekly Lead Attribution Reporting System using n8n, Google Sheets, Azure OpenAI, and Gmail.
It runs on a schedule and automatically pulls lead data from Google Sheets.
The workflow cleans and normalizes inconsistent source and spend fields.
Leads are aggregated by channel with total counts calculated.
Ad spend is processed to compute accurate Cost Per Lead (CPL) per source.
A structured JSON summary is prepared for reporting.
GPT-4o-mini converts the data into a professional, responsive HTML report.
The report includes key metrics, CPL breakdown, insights, and priority actions.
The final output is mobile-friendly and email-ready.
The report is automatically sent via Gmail with zero manual effort.