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
Extract website analytics with n8n and Google Analytics

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

Learn how to Build this Workflow with AI:

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.


Extract website analytics with n8n and Google Analytics

Visit through Desktop to Interact with the Workflow.

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 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.