This n8n automation tracks the number of daily YouTube views generated from YouTube Search for your channel, using the YouTube Analytics API, and updates them into a connected Google Sheet.
- Automatically runs daily at 12 PM
- Fetches views from YouTube Search (using
insightTrafficSourceType
) - Writes data into the correct cell in a Google Sheet based on date
- Easy to modify and extend for other traffic sources
- A YouTube channel
- n8n installed (locally or on cloud)
- Google OAuth2 credentials for:
- YouTube Analytics API
- Google Sheets API
- Clone this repository
- Import
workflow.json
into your n8n instance - Connect your own credentials:
- When creating the Google credentials connection inside n8n, make sure to authorize with the following scope for YouTube Analytics:
https://www.googleapis.com/auth/yt-analytics.readonly
- Replace the Google credentials under:
Fetch YT Analytics
Update Google Sheet
- When creating the Google credentials connection inside n8n, make sure to authorize with the following scope for YouTube Analytics:
- Update the Google Sheets ID in the workflow with your actual spreadsheet ID.
- (Optional) Modify the trigger time, sheet range, or logic to suit your needs.
You can copy the Google Sheet from here for testing purpose: YouTube SEO Dashboard Sheet
- Code: MIT License
- Screenshots & Docs: CC BY 4.0 — Attribution required
Credit: Moksh Bhardwaj
Moksh Bhardwaj
🔗 YouTube
🔗 Super Profile
🔗 GitHub
🎥 Watch the full tutorial on YouTube coming soon...
⭐ Star this repo if you find it useful and want more tech tutroials!