Quick overview
This workflow runs every Monday at 8am, pulls last-7-days performance data from the Meta Ads API, Google Ads API, and Google Analytics 4, calculates blended KPIs, uses OpenAI to generate a client-friendly insight summary, and delivers an HTML report by Gmail while posting status update to Slack.
How it works
- Runs every Monday at 8am on a schedule trigger.
- Fetches the last 7 days of spend and engagement metrics from the Meta Ads Insights endpoint.
- Fetches the last 7 days of campaign cost, clicks, and conversions from the Google Ads API using a streamed search query.
- Fetches the last 7 days of conversions and revenue by default channel group from the Google Analytics 4 Data API.
- Combines the three datasets and calculates blended totals for spend, conversions, revenue, and ROAS.
- Sends the blended metrics to OpenAI to generate a 3–4 sentence plain-language weekly performance summary.
- Builds a simple HTML report and sends it to the client via Gmail while posting a short “report sent” summary to a Slack channel.
- If the workflow execution fails, posts the error message to an ops Slack channel.
Setup
- Add credentials and replace the placeholders for your Meta Ads token and ad account ID in the Meta Ads Insights request.
- Add Google Ads authentication and replace
YOUR_CUSTOMER_ID in the Google Ads request.
- Add Google Analytics 4 authentication and replace
YOUR_GA4_PROPERTY_ID in the GA4 report request.
- Add an OpenAI API key for the Chat Model used by the AI Agent.
- Connect your Gmail account and set the recipient email address used to send the HTML report.
- Connect Slack and set the channel IDs for the client-report update and ops-alert notifications.