n8nflow.net logo

Track Website Traffic & Backlinks with Ahref API and Google Sheets

by Sk developer•Updated: Last update 10 days ago•Source: n8n.io
Loading workflow viewer...

Getting Started

šŸ“Š Automated Website Traffic Tracker with Google Sheets Logging

Track website traffic and backlinks effortlessly using the Website Traffic Checker - Ahref API. This n8n workflow automates data retrieval and logging into Google Sheets, making it perfect for SEO professionals and digital marketers.


🧩 What This Workflow Does (Summary)

  1. Accepts a domain via a simple web form.

  2. Sends the domain to Website Traffic Checker - Ahref API.

  3. If successful:

    • Extracts backlink and traffic data.
    • Appends the results to two separate Google Sheets.
  4. If failed:

    • Sends an email alert with domain and status code.

šŸ”§ Node-by-Node Explanation

NodePurpose
🟢 Form TriggerStarts the workflow when a domain is submitted via form.
🟩 Set Domain ValueStores the submitted domain into a variable.
🌐 HTTP RequestCalls Website Traffic Checker - Ahref API.
āœ… IF NodeChecks if the API responded with statusCode = 200.
āŒ Email Node (Fail)Sends an alert email if API fails.
šŸ“¦ Code (Backlink Info)Extracts backlink data from API response.
šŸ“„ Google Sheet: Backlink InfoAppends backlink data to a sheet.
šŸ“¦ Code (Traffic Info)Extracts traffic data from API response.
šŸ“„ Google Sheet: Traffic DataAppends traffic metrics to another sheet.

šŸ“ Google Sheet Columns

Backlink Info Sheet

ColumnDescription
websiteDomain submitted
ascoreAuthority score
referring domainNumber of referring domains
total backlinksTotal backlinks

Traffic Data Sheet

ColumnDescription
accuracyAccuracy level of the traffic data
bounce_rateBounce rate percentage
desktop_sharePercentage of traffic from desktop devices
directDirect traffic sources
display_adDisplay ad traffic sources
display_dateDate when traffic data was captured
mailTraffic from email campaigns
mobile_sharePercentage of traffic from mobile devices
pages_per_visitAverage number of pages per visit
paidPaid traffic sources
prev_bounce_rateBounce rate in the previous period
prev_directPrevious period's direct traffic
prev_display_adPrevious period's display ad traffic
prev_mailPrevious period's email traffic
prev_pages_per_visitPrevious period's pages per visit
prev_referralPrevious period's referral traffic
prev_search_organicPrevious organic search traffic
prev_search_paidPrevious paid search traffic
prev_social_organicPrevious organic social traffic
prev_social_paidPrevious paid social traffic
prev_time_on_sitePrevious time spent on site
prev_usersNumber of users in the previous period
prev_visitsVisits in the previous period
rankGlobal rank of the website
referralReferral traffic
searchTotal search traffic
search_organicOrganic search traffic
search_paidPaid search traffic
socialTotal social traffic
social_organicOrganic social traffic
social_paidPaid social traffic
targetTargeted country or demographic
time_on_siteAverage time spent on site
unknown_channelTraffic from unknown sources
usersNumber of unique users
visitsTotal number of visits

šŸ” How to Configure

šŸ”‘ Get API Key

  1. Go to Website Traffic Checker - Ahref API on RapidAPI.
  2. Sign in or create a free RapidAPI account.
  3. Subscribe to the API plan.
  4. Copy your x-rapidapi-key from the Endpoints tab.

šŸ“ Add Key in n8n

  1. Go to your HTTP Request node.

  2. Under Headers , set:

    • x-rapidapi-host = website-traffic-checker-ahref.p.rapidapi.com
    • x-rapidapi-key = your API key

šŸ“„ How to Setup Google Sheets in n8n

  1. Connect a Google account via Google Sheets credentials in n8n.
  2. Use the full Google Sheet URL in the documentId field.
  3. Set correct Sheet name or GID (e.g., "Traffic Data").
  4. Use Auto Map or Custom Map to define columns.

Make sure your Google Sheet has edit access and headers already created.


🧠 Use Case & Benefits

šŸ‘¤ Ideal For:

  • SEO analysts
  • Digital marketers
  • Agencies managing multiple clients
  • Web analytics consultants

āœ… Benefits:

  • Fully automated data collection.
  • No manual copy-paste from tools.
  • Real-time insights delivered to Google Sheets.
  • Easy monitoring of backlinks and traffic trends.