N8N Tools - YouTube Enhanced icon

N8N Tools - YouTube Enhanced

Comprehensive YouTube Data API v3 and Analytics integration for N8N workflows

Actions83

Overview

The node provides enhanced integration with YouTube's Data API v3 and Analytics API, allowing users to retrieve detailed analytics data about their YouTube channels, videos, playlists, and content owners. Specifically, the "Get Traffic Source Data" operation under the "Analytics" resource fetches information about where viewers are coming from when they watch a channel’s content. This is useful for understanding audience acquisition channels, optimizing marketing strategies, and improving content reach.

Practical examples include:

  • Analyzing which external websites or YouTube features drive the most traffic to your channel.
  • Measuring the effectiveness of promotional campaigns by tracking referral sources.
  • Identifying top traffic sources to focus content distribution efforts.

Properties

Name Meaning
Channel ID The unique identifier of the YouTube channel for which to retrieve traffic source analytics.
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 metrics to include in the report. Options include: views, estimatedMinutesWatched, averageViewDuration, averageViewPercentage, subscribers, likes, dislikes, comments, shares, estimatedRevenue, adRevenue, grossRevenue, cpm, cpc, impressions, monetizedPlaybacks, playbackBasedCpm, annotationImpressions, annotationClicks, annotationClickableImpressions, annotationClosableImpressions, annotationCloses, annotationCloseRate, cardImpressions, cardClicks, cardClickRate, cardTeaserImpressions, cardTeaserClicks, cardTeaserClickRate, audienceWatchRatio, relativeRetentionPerformance.
Max Results Maximum number of results to return (default 100, min 1, max 1000).
Start Index The index of the first result to return (default 1, minimum 1).

Output

The output is a JSON object containing the requested traffic source analytics data for the specified channel and date range. The structure typically includes dimensions such as traffic source types and corresponding metric values (e.g., views, watch time). The exact shape depends on the selected metrics and the YouTube Analytics API response format.

No binary data is output by this operation.

Dependencies

  • Requires an active subscription and valid API key credential for the external service providing enhanced YouTube API access.
  • Requires OAuth2 credentials for YouTube API access configured in n8n.
  • The node internally validates the API key subscription before making requests.
  • No additional environment variables are required beyond standard n8n credential setup.

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 correct and has an active subscription.
  • Missing Required Parameters: Ensure that all required fields like Channel ID, Start Date, End Date, and Metrics are provided.
  • API Rate Limits: Exceeding YouTube API quotas may cause errors; consider reducing Max Results or optimizing request frequency.
  • Date Range Issues: Invalid or reversed start/end dates can cause errors; ensure Start Date is before End Date.
  • Empty Results: If no data is returned, verify that the channel has sufficient traffic during the specified date range and that the selected metrics are applicable.

Links and References

Discussion