Automate SEO Analysis with Google Analytics & n8n

This workflow automates comparison of weekly Google Analytics and Search Console data, feeding insights into AI for SEO recommendations. Save hours analyzing site engagement and search performance with n8n automation.
googleAnalytics
httpRequest
code
+4
Workflow Identifier: 2273
NODES in Use: Schedule Trigger, Manual Trigger, Sticky Note, Google Analytics, Code, HTTP Request, Baserow
Automate SEO with Google Analytics and n8n

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

Learn how to Build this Workflow with AI:

What This Automation Does ⚙️

This workflow collects SEO data from Google Analytics and Google Search Console for two weeks.

It compares this week’s and last week’s metrics on page views, countries, and search results.

Then it sends the data to an AI model using the Openrouter API.

The AI creates a report with improvement ideas and tables in markdown format.

Finally, the workflow saves these SEO insights into a Baserow database.

This saves time, reduces errors, and gives clear SEO suggestions quickly.


Tools and Services Used

  • Google Analytics: Provides site page engagement, country user data, and search metrics.
  • Google Search Console: Supplies search performance and landing page data.
  • Openrouter API: Sends data to an AI model (meta-llama/llama-3.1-70b-instruct) for analysis and suggestions.
  • Baserow Database: Stores AI-generated SEO reports in organized tables.
  • n8n Workflow Automation: Connects all services and handles scheduled or manual runs.

Inputs, Processing Steps, and Outputs

Inputs

  • Google Analytics data for current and previous weeks on page views, user engagement, country stats.
  • Google Search Console metrics for search queries and landing pages.
  • User’s Google Analytics credentials, Openrouter API key, and Baserow access details.

Processing Steps

  • Schedule Trigger starts the workflow weekly; Manual Trigger allows immediate run.
  • Google Analytics nodes fetch metrics for two weeks using date ranges.
  • Code nodes parse and simplify raw GA data into structured JSON.
  • HTTP Request nodes send structured data to Openrouter AI with prompts to compare weeks and generate SEO insights.
  • Baserow node saves the AI-generated reports into a table with relevant columns.
  • Sticky Note nodes provide documentation within the workflow.

Outputs

  • Markdown tables showing SEO metrics comparisons.
  • Five SEO improvement suggestions from AI.
  • Data records added to Baserow database for tracking and review.

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

Step 1: Import Workflow

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

Step 2: Configure Credentials and Settings

  1. Add or update Google Analytics OAuth2 credentials in the Google Analytics nodes.
  2. Add your Openrouter API key in the HTTP Request nodes under Header Auth with “Authorization” header as “Bearer YOUR_API_KEY”.
  3. Update Baserow database ID and table ID in the Baserow node to point to your workspace.
  4. If the workflow includes any IDs like Google Analytics property ID or email, update them accordingly.
  5. Copy and paste any code or prompt text exactly if needed in Code or HTTP Request nodes.

Step 3: Test the Workflow

  1. Run the workflow manually using the Manual Trigger node.
  2. Check each node’s output to confirm correct data fetching and parsing.
  3. Make sure AI responses appear and Baserow rows get created with data.

Step 4: Activate for Production Use

  1. Turn on the workflow by toggling the Active switch in n8n.
  2. The Schedule Trigger will then run the workflow automatically at set intervals (weekly by default).
  3. Monitor execution logs regularly to catch any errors early.

If hosting on your own server, consider self-host n8n to control data and uptime.


Troubleshooting 🔧

  • Invalid data structure errors often mean Google Analytics response changed. Check that metrics and dimensions in GA nodes match your property and that data exists. Insert temporary debug nodes to view raw API output.
  • 401 Unauthorized errors from Openrouter API mean problem with API key or Authorization header. Make sure header is “Authorization: Bearer YOUR_API_KEY” with a space after Bearer.
  • Baserow data not saving can be from wrong database/table IDs or missing write rights. Double-check Baserow API token and IDs. Test Baserow connection node separately if needed.

Customization Ideas ✏️

  • Change scheduling interval in Schedule Trigger node for daily, weekly, or monthly runs.
  • Add more Google Analytics metrics like “bounceRate” or “sessionDuration” for deeper analysis.
  • Switch AI model in HTTP Request nodes to try different Openrouter LLM models for alternative insights.
  • Add output nodes to export Baserow data to Google Sheets, Slack, or email for team sharing.
  • Use Manual Trigger node to run anytime when immediate SEO reports are needed.

Summary of Workflow Benefits

✓ Saves at least 5 hours of manual work weekly for SEO data analysis.

✓ Reduces errors by automating data fetching and parsing.

✓ Produces clear markdown tables and specific SEO improvement ideas by AI.

✓ Stores useful SEO reports in an easy-to-use Baserow database.

→ Runs fully automatically on schedule or manually on demand.


Automate SEO with Google Analytics and n8n

Visit through Desktop to Interact with the Workflow.

Frequently Asked Questions

Add Google Analytics OAuth2 credentials in the Google Analytics nodes within n8n. Ensure they have read access to the correct Google Analytics property ID.
401 Unauthorized errors usually mean the API key is missing, incorrect, or the Authorization header is not properly formatted as “Bearer YOUR_API_KEY” with a space after Bearer.
Edit the Google Analytics nodes by adding desired metrics or dimensions. Be sure that the new metrics are supported by Google Analytics and update parsing code nodes if needed.
Yes, the workflow includes a Manual Trigger node that allows manual runs anytime without waiting for the schedule.
Author
Written By
Vikash Kumar
Building AI agents, n8n workflows and end-to-end automation for 30+ Brands across India, the US, Europe, Dubai & Australia. 7+ years of Experience saving founders real hours every week - no code required.

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.