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

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

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

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.


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.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free