N8N Tools - YouTube Enhanced icon

N8N Tools - YouTube Enhanced

Comprehensive YouTube Data API v3 and Analytics integration for N8N workflows

Actions83

Overview

This node operation fetches YouTube ad performance analytics data for a specified channel over a defined date range. It is designed to retrieve detailed metrics related to advertisements on a YouTube channel, helping content creators, marketers, and analysts understand how ads are performing in terms of revenue, impressions, clicks, and other engagement indicators.

Common scenarios where this node is beneficial include:

  • Monitoring the effectiveness of YouTube ad campaigns.
  • Analyzing revenue generated from ads on a channel.
  • Tracking ad impressions and click-through rates to optimize monetization strategies.
  • Integrating YouTube ad performance data into broader marketing or business intelligence workflows.

For example, a user can specify a YouTube Channel ID, select relevant ad-related metrics (like estimated revenue, CPM, CPC), and define a start and end date to generate a report showing how ads performed during that period.

Properties

Name Meaning
Channel ID The unique identifier of the YouTube channel for which to retrieve ad performance data.
Start Date The beginning date for the analytics data range (inclusive).
End Date The ending date for the analytics data range (inclusive).
Metrics The specific ad performance metrics to include in the report. Options include:
- Views, Estimated Minutes Watched, Average View Duration, Average View Percentage
- Subscribers, Subscribers Gained, Subscribers Lost
- Likes, Dislikes, Comments, Shares
- Estimated Revenue, Ad Revenue, Gross Revenue
- CPM (Cost Per Mille), CPC (Cost Per Click)
- Impressions, Monetized Playbacks, Playback Based CPM
- Annotation Impressions, Annotation Clicks, Annotation Clickable Impressions, Annotation Closable Impressions, Annotation Closes, Annotation Close Rate
- Card Impressions, Card Clicks, Card Click Rate, Card Teaser Impressions, Card Teaser Clicks, Card Teaser Click Rate
- Audience Watch Ratio, Relative Retention Performance
Max Results Maximum number of results to return (default 100, min 1, max 1000).
Start Index Index of the first result to return (default 1, minimum 1).

Output

The output is a JSON array where each item contains the ad performance data retrieved from YouTube Analytics API for the specified channel and date range. Each JSON object includes the requested metrics and their values, structured according to YouTube's Analytics API response format.

The exact structure depends on the selected metrics but typically includes time series or aggregated data points such as views, revenue, impressions, clicks, and other engagement statistics related to ads.

No binary data output is produced by this operation.

Dependencies

  • Requires an active subscription and valid API key for the external "N8N Tools API" service, which acts as a proxy or enhancer for YouTube API calls.
  • Requires OAuth2 credentials configured for YouTube API access.
  • The node internally uses multiple helper classes to interact with YouTube APIs, including analytics endpoints.
  • Proper configuration of these credentials and API keys within n8n is necessary for successful execution.

Troubleshooting

  • Invalid Subscription or API Key: If the node throws an error indicating invalid subscription or API key, verify that the API key credential is correctly set up and has the necessary permissions.
  • API Quotas or Limits: YouTube Analytics API enforces quotas; exceeding them may cause errors or incomplete data. Monitor quota usage and adjust requests accordingly.
  • Incorrect Channel ID or Date Range: Providing an invalid channel ID or nonsensical date ranges (e.g., start date after end date) will result in errors or empty responses.
  • Missing Required Parameters: Ensure all required properties (Channel ID, Start Date, End Date, Metrics) are provided; otherwise, the node will fail.
  • Network or Service Errors: Temporary network issues or service downtime can cause request failures. Retrying later or checking service status is recommended.

Links and References

Discussion