A production-ready, enterprise-level automation system that automatically analyzes Google Ads performance data, provides AI-powered insights, and sends intelligent notifications based on performance trends. Built with comprehensive error handling and real-world scenario management.
- Automatic Triggering: Responds to new data in Google Sheets
- AI-Powered Analysis: Uses Google Gemini AI for intelligent performance insights
- Smart Notifications: Conditional Slack alerts based on performance status
- Data Validation: Comprehensive input validation with error handling
- Historical Context: Week-over-week comparison or industry benchmarks
- What-If Logic: Handles all edge cases gracefully
- Retry Mechanisms: Automatic retry on AI failures
- Fallback Systems: Manual review channels for unexpected scenarios
- Error Monitoring: Comprehensive error tracking and alerting
- Data Quality Checks: Validates input data before processing
- Week-over-Week Comparison: When previous week data is available
- Industry Benchmarks: When historical data is missing
- Structured Insights: Consistent JSON output format
- Actionable Recommendations: Specific optimization suggestions
- Validates incoming Google Sheets data
- Checks for missing fields, invalid types, and #REF! errors
- Routes invalid data to error notification channel
- Fetches historical data for context
- Prepares data for AI analysis
- Handles missing previous week data gracefully
- Leverages Google Gemini AI for intelligent analysis
- Provides structured insights and recommendations
- Supports both comparison and benchmark analysis
- Validates AI output structure and content
- Implements retry logic for failed AI responses
- Routes invalid outputs to manual review
- Updates Google Sheets with AI insights
- Sends appropriate Slack notifications based on performance
- Handles all notification scenarios
- Built on: n8n (Node.js-based workflow automation)
- AI Model: Google Gemini 2.0 Flash
- Integrations: Google Sheets, Slack, Google Gemini API
Required Google Sheets Columns:
- Week (numeric)
- Campaign Name (text)
- Status (text)
- Budget (β¬) (numeric)
- CTR (%) (numeric)
- Clicks (numeric)
- CPC (β¬) (numeric)
- Cost (β¬) (numeric)
- Conversions (numeric)
- Impression Share (%) (numeric)
AI Analysis Output:
{
"interpretation": "Performance analysis summary (max 200 words)",
"recommendations": ["Actionable recommendation 1", "Actionable recommendation 2"]
}-
Stable Performance (
#for-stable-good-updates)- Triggered when performance is stable/improved
- Green circle emoji, positive messaging
-
Action Required (
#marketing-action-items)- Triggered when optimization is needed
- Red circle emoji, actionable recommendations
-
Error Handling (
#workflow-errors)- Data validation failures
- AI analysis failures
- System-level errors
Stable Performance:
π’ Weekly Ad Performance Update - Stable Performance
Campaign: Campaign 1
Week: 1
Analysis Context: week-over-week
AI Summary: Week 27 shows stable performance with CTR at 2.5%...
β
All systems go! Performance is stable this week.
Action Required:
π΄ Action Required: Weekly Ad Performance Alert!
Campaign: Campaign 1
Week: 1
Analysis Context: industry-benchmarks
AI Summary: CTR at 1.2% is below industry average...
Recommendations:
β’ 1. Optimize ad copy to improve click-through rates
β’ 2. Review keyword targeting for better relevance
π¨ Let's review this ASAP and take action.
- β Missing required fields β Error notification
- β Invalid data types β Error notification
- β #REF! errors β Error notification
- β Empty values β Error notification
- β Invalid JSON output β Retry logic (2 attempts)
- β Missing required fields β Fallback to manual review
- β Malformed structure β Fallback to manual review
- β API failures β Fallback to manual review
- β Ambiguous output β Manual review channel
- β Missing previous week data β Industry benchmarks
- β Multiple campaigns β Campaign-specific matching
- β Data gaps β Graceful degradation
- β Workflow errors β Global error handler
- β Node failures β Comprehensive error logging
- β Network issues β Retry mechanisms
- CTR: Good >2.0%, Average 1.5-2.0%, Poor <1.5%
- CPC: Good <β¬2.0, Average β¬2.0-3.0, Poor >β¬3.0
- Conversion Rate: Good >3%, Average 2-3%, Poor <2%
- Impression Share: Good >80%, Average 50-80%, Poor <50%
- Week-over-Week: When previous week data is available
- Industry Benchmarks: When historical data is missing
- Isolated Analysis: For first-time campaigns
- Google Sheets integration with OAuth2
- Slack workspace-specific channels
- API key management through n8n credentials
- n8n instance (self-hosted or cloud)
- Google Sheets with performance data
- Slack workspace with designated channels
- Google Gemini API access
- Import Workflow: Import the JSON file into n8n
- Configure Credentials: Set up Google Sheets and Slack credentials
- Update Sheet IDs: Replace Google Sheet document IDs
- Update Channel IDs: Replace Slack channel IDs
- Test Workflow: Add test data to Google Sheets
- Activate Workflow: Enable the workflow for production
- Google Sheets: Read/Write access to performance data sheet
- Slack: Post messages to designated channels
- Google Gemini: API access for AI analysis
- Valid Data Flow: Add valid performance data
- Missing Previous Week: Test with first week data
- Invalid Data: Test with missing/invalid fields
- AI Failure: Test with malformed AI output
- System Error: Test error handling mechanisms
- β Valid data β AI analysis β Appropriate notification
- β Invalid data β Error notification β No processing
- β AI failure β Retry β Fallback notification
- β System error β Global error notification
- Check Slack error channels regularly
- Monitor workflow execution logs
- Review AI analysis quality periodically
- Track notification accuracy
- Data Issues: Check Google Sheets format and permissions
- AI Issues: Verify Gemini API credentials and quotas
- Notification Issues: Check Slack channel permissions
- Workflow Issues: Review n8n execution logs
- Regular workflow performance reviews
- AI prompt optimization based on feedback
- Benchmark updates as industry standards change
- Error handling improvements based on real-world usage
- Automated Insights: No manual analysis required
- Proactive Alerts: Early warning for performance issues
- Consistent Reporting: Standardized analysis format
- Time Savings: Automated weekly performance reviews
- Performance Optimization: Data-driven improvement recommendations
- Cost Efficiency: Reduced manual analysis overhead
- Scalability: Handles multiple campaigns and accounts
- Reliability: Robust error handling ensures continuous operation
Built with β€οΈ for automated performance optimization
