Automate Weekly Online Marketing Reports with n8n

Automate the collection, analysis, and reporting of weekly online marketing data from Google Analytics, Google Ads, and Meta Ads using n8n. This workflow saves hours of manual data gathering by generating AI-powered summaries and sending professional reports via email and Telegram.
scheduleTrigger
lmChatOpenAi
googleAnalytics
+9
Workflow Identifier: 1289
NODES in Use: Schedule Trigger, OpenAI Chat Model, ToolWorkflow, Google Analytics, Code, HTTP Request, Set, Summarize, EmailSend, Facebook Graph API, Telegram, Langchain Agent
Automate reports with n8n and Google Analytics

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

What This Automation Does

This workflow runs every Monday at 7 a.m. and collects marketing data from several places automatically.
It solves the problem of spending many hours manually looking up data on multiple platforms.
At the end, it sends a clear email report showing how ads and website did, comparing this week to last year.
You get fast, accurate weekly reports without doing all the work.


Inputs, Processing, and Outputs

Inputs

  • Google Analytics API: Website and e-commerce metrics from multiple domains.
  • Google Ads API: Advertising campaign data and performance metrics.
  • Meta Ads (Facebook Graph API): Social advertising metrics.
  • Date ranges: Dynamic last 7 days and same 7 days last year.

Processing Steps

  • Calculate date ranges in code nodes for dynamic queries.
  • Fetch data from Google Ads and Meta Ads for current and last year periods.
  • Fetch website and e-commerce stats from Google Analytics for the same periods.
  • Process and summarize raw data into totals and important metrics like CTR and ROAS.
  • Use AI, GPT-4, to create easy-to-read summaries and tables.
  • Compile all these pieces into one HTML email and optional telegram message.

Outputs


Why Use This Workflow

Manual weekly reporting wastes many hours.
Manual data entry can cause errors.
This workflow saves time and gives fast, clear insights.
You can trust the numbers to be correct and timely.


Beginner Step-by-Step: How to Use This Workflow in n8n

Step 1: Import the workflow

  1. Download the workflow file using the Download button on this page.
  2. In the n8n editor, click on “Import from File” and upload the downloaded workflow.

Step 2: Add credentials and settings

  1. Enter your Google Analytics OAuth2 credentials.
  2. Enter Google Ads OAuth2 credentials and developer token.
  3. Add Facebook Graph API credentials.
  4. Insert the OpenAI API key for GPT-4.
  5. Fill SMTP email account details to enable email sending.
  6. Add Telegram API credentials if you want messages sent there.
  7. Update any domain IDs, email addresses, or chat channel IDs in the nodes as needed.

Step 3: Test the workflow

  1. Run the workflow manually once to check data retrieval and report generation.
  2. Look for errors in the execution panel and fix any credentials or settings issues.

Step 4: Activate for production

  1. Enable the workflow to run on schedule every Monday at 7 a.m.
  2. Monitor first few runs to ensure emails are sent correctly.
  3. Once stable, rely on the workflow to deliver reports automatically.

For users wanting full control by running n8n on server, check self-host n8n options.


Tools and Services Used

  • Google Analytics API: Gets website and e-commerce data.
  • Google Ads API: Provides campaign metrics like clicks and cost.
  • Facebook Graph API: Fetches Meta Ads performance data.
  • OpenAI API (GPT-4): Creates natural language summaries from numbers.
  • SMTP Email Account: Sends composed email automatically.
  • Telegram Bot API (optional): Sends shortened report messages.
  • n8n workflow automation platform: Connects all steps and manages scheduling.

Common Problems and Fixes

  • 401 Unauthorized in Google Ads API: Fix by reauthenticating OAuth and verifying developer token.
  • OpenAI node errors: Check API key limits and verify model ID is “gpt-4o” or similar.
  • Email not sent: Confirm SMTP username, password, and sender email are correct.

Customization Ideas

  • Add other ad platforms like Bing Ads or LinkedIn Ads with new API nodes.
  • Change schedule timing to daily, biweekly, or monthly through the Schedule Trigger.
  • Modify AI prompts in OpenAI nodes to generate reports in other languages.
  • Include more metrics like bounce rate or new users in Code nodes.
  • Adjust HTML styling in the email to match brand colors or logos.

Summary

✓ Saves over 3 hours every week by automating report building.
✓ Automatically pulls data from Google Analytics, Google Ads, and Meta Ads.
✓ Calculates important metrics and compares this week to last year.
✓ Uses AI to write clear summaries and professional emails.
✓ Sends reports by email and optionally Telegram for fast team updates.
✓ Removes mistakes that happen when doing this by hand.


// Code example: Date calculation for Google Ads query
const today = new Date();
const end = new Date(today);
end.setDate(today.getDate() - 1);
const start = new Date(end);
start.setDate(end.getDate() - 6);
function formatDate(date) {
  const year = date.getFullYear();
  const month = String(date.getMonth() + 1).padStart(2, '0');
  const day = String(date.getDate()).padStart(2, '0');
  return `${year}${month}${day}`;
}
return { startDate: formatDate(start), endDate: formatDate(end) };
Automate reports with n8n and Google Analytics

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

Download the workflow file from this page, then use the Import from File feature inside the n8n editor. Add all required API keys and credentials, update IDs or emails if needed, test the workflow, and finally activate it.
This error usually means the OAuth credentials expired or the developer token is incorrect. Reauthenticate and verify tokens in the workflow credentials settings.
Yes, the workflow includes optional Telegram nodes that send a condensed text version of the weekly report to chosen channels or groups.
Yes, by editing the prompts inside the OpenAI nodes, the summary and report can be generated in other languages such as Spanish or French.

Promoted by BULDRR AI

Related Workflows

Automate Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.