Extract Website Analytics and Save to Airtable with n8n

Discover how to automate the extraction of website analytics from Google Analytics and seamlessly store them into Airtable using n8n. This workflow helps digital marketers and data analysts save time by automating data collection and organization without manual effort.
manualTrigger
googleAnalytics
set
+1
Workflow Identifier: 2449
NODES in Use: Manual Trigger, Google Analytics, Set, Airtable

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

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

2. What This Automation Does

This workflow gets session counts by country from Google Analytics and adds that data into Airtable automatically.
It stops manual work and errors by fetching, cleaning, and saving data for a chosen time.
The result is monthly session data in Airtable without you copying anything.

The workflow starts when you trigger it manually.
It asks Google Analytics for session numbers split by country.
Then it changes the data format so Airtable can accept it.
Finally, it adds each country’s sessions as new Airtable records.

This saves time, avoids mistakes, and makes reports ready quickly.


3. Prerequisites ⚙️

  • Google Analytics account: Must have API access and a valid View ID.
  • Airtable account: Should have a base and table ready for session data.
  • n8n account: Could be cloud or self-hosted with OAuth and API keys stored.
  • Google Analytics OAuth2 credentials: Created and linked inside n8n.
  • Airtable API credentials: Made and connected in n8n.

4. Step-by-Step Guide

Step 1: Set up the Manual Trigger in n8n

Inside n8n, make a new workflow.
Add the Manual Trigger node from the node list.
No special settings needed here; just place it.
This lets you start the flow anytime you want.

Result: Workflow begins with a manual click.

Step 2: Configure the Google Analytics Node

Add the Google Analytics node next to the trigger.
Link the Manual Trigger output to this node input.
Enter your Google Analytics View ID exactly.
In Additional Fields, set metrics and dimensions:

  • Metrics: “ga:sessions” to get session numbers.
  • Dimensions: “ga:country” to separate by country.
  • Date Range: Set startDate and endDate like “2019-12-31” to “2020-08-30”.

Pick your Google Analytics OAuth2 credential.
Wrong View ID or bad date formats cause errors.
This node pulls session counts by country.

Step 3: Process Data with the Set Node

Add a Set node after Google Analytics.
Use it to rename and clean data for Airtable.
Create two fields:

  • Metric (Number) with value {{$json["total"]}}.
  • Country (String) with value {{$json["ga:country"]}}.

Enable the Keep Only Set option to keep only these.
This prepares data for Airtable.

Step 4: Append Data to Airtable

Add the Airtable node after the Set.
Connect the Set node output to Airtable input.
Set the node to append records in your table (e.g., “Table 1”).
Select Airtable API credentials.
Make sure Airtable base has fields named Metric and Country exactly.
Wrong field names or types stop data from saving.
Each run adds new country session records.


4a. Beginner Step-by-Step: Using This Workflow in Production

Download and Import

  1. Click the Download button on this page to get the workflow file.
  2. Open n8n editor.
  3. Go to the main menu, choose Import from File, then select the downloaded file.

Configure Credentials

  1. Add Google Analytics OAuth2 credentials in n8n if not already set.
  2. Add Airtable API credentials with your API key.
  3. Update the Google Analytics View ID in the Google Analytics node.
  4. Check Airtable node to confirm correct base and table, and that fields “Metric” and “Country” exist.

Test and Activate

  1. Run the workflow using the Manual Trigger to test end-to-end.
  2. If data inserts correctly in Airtable, activate the workflow.
  3. For automation, replace the Manual Trigger with a Cron node set to monthly or desired schedule.
  4. Monitor runs in n8n’s execution log.

For those using self-host n8n, importing and running workflows works the same.


5. Inputs, Processing Steps, and Output

Inputs

  • Manual trigger to start workflow.
  • Google Analytics View ID for which data is requested.
  • Date range for session data.

Processing Steps

  • Query Google Analytics API to get sessions grouped by country.
  • Use a Set node to rename and filter data fields to match Airtable.
  • Append each country’s session metric into Airtable.

Output

New records in Airtable table with columns “Country” and “Metric” showing session counts.
Data is ready for team analysis.


6. Customizations ✏️

  • Change metrics in Google Analytics node to get users or bounce rates.
  • Automate date ranges with n8n expressions to always use last month.
  • Use a Function node to filter countries if only some are needed.
  • Switch Airtable node from append to update mode to avoid duplicate records.
  • Add a Gmail node to send report summaries by email after inserting data.

7. Troubleshooting 🔧

Problem: “Invalid View ID or Unauthorized” error

Check that View ID is correct and OAuth credentials have read access.
Refresh credentials if needed.

Problem: “Failed to Append Records in Airtable”

Check Airtable field names exactly match “Metric” and “Country”.
Verify data types and API usage limits.


8. Pre-Production Checklist ✅

  • Google Analytics OAuth2 credentials are valid with read scope.
  • View ID matches the correct property and view.
  • Airtable base and table have number field “Metric” and text field “Country”.
  • Test manual trigger and confirm no errors.
  • Backup Airtable data before big inserts.

9. Deployment Guide

Turn workflow toggle ON in n8n.
Run a manual start to check everything works.
Replace manual trigger with Cron node for scheduled runs.
Use execution logs to monitor.


10. FAQs

11. Conclusion

✓ Automated monthly data retrieval from Google Analytics by country.
✓ Cleaned session counts formatted for Airtable.
✓ Saved hours by removing manual export and copy-paste.
✓ Added reliable, error-free reports for easy sharing.
✓ Ready for extending with emails or more metrics.

→ The user gains simple steps to build and use workflow in n8n.
→ Results improve productivity and data quality.
→ Experiment with dates and metrics to adjust insights.


Frequently Asked Questions

Check that the View ID is correct and the Google Analytics OAuth2 credentials have permission to read data.
This happens when Airtable field names don’t exactly match the workflow or API limits are reached. Ensure field names “Metric” and “Country” exist with correct types and check Airtable API quota.
Yes, replace the Manual Trigger node with a Cron node set to run monthly.
Yes, replace the Airtable node with nodes for other services like Google Sheets which support data appending.

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