YouTube Player

YouTube Player

YouTube Player embeds YouTube videos on external websites via iframe. Scripts load from Google's servers and set cookies for video playback preferences, watch history, and ad targeting. Cookies are dropped even when visitors only view the embed without interacting with the player.

Overview

YouTube Player is the standard video embed mechanism for displaying YouTube-hosted videos on external websites. As a Google product, the YouTube iframe embed carries Google's full advertising and tracking infrastructure with it — setting cookies, loading ad scripts, and transmitting viewing data to Google even before the visitor clicks play. YouTube embeds are ubiquitous across the web, appearing on blogs, news sites, e-commerce product pages, documentation, and virtually any site that hosts video content.

What This Script Does

YouTube videos embed via an iframe from youtube.com or youtube-nocookie.com, loading Google's video player and associated tracking infrastructure.

Standard Embed (youtube.com)

  • Iframe loaded: youtube.com/embed/{video_id} — loads the YouTube player, video metadata, and Google's advertising and analytics scripts within a cross-origin iframe
  • Cookies set on page load (before any interaction):
    • VISITOR_INFO1_LIVE — Third-party cookie on youtube.com (6-month expiry). Estimates bandwidth and determines player interface version.
    • YSC — Third-party cookie on youtube.com (session). Unique session identifier tracking video views.
    • GPS — Third-party cookie on youtube.com (30-minute expiry). Stores geographic location for mobile tracking.
    • IDE — Third-party cookie on doubleclick.net (13-month expiry, 24 hours in EEA). Cross-site ad targeting and conversion attribution.
    • CONSENT — Third-party cookie on youtube.com. Records consent state.
  • Data collected: Video view events, watch duration, pause/resume interactions, player errors, browser user agent, IP address (for geolocation), and referring page URL. This data is transmitted to YouTube/Google's analytics and advertising systems.
  • Ad serving: If the video has ads enabled, pre-roll, mid-roll, and overlay ads are served from Google's ad infrastructure, loading additional ad tracking scripts within the iframe.

Privacy-Enhanced Embed (youtube-nocookie.com)

  • Iframe loaded: youtube-nocookie.com/embed/{video_id} — loads the YouTube player with reduced tracking
  • Cookie behavior: Cookies are not set until the visitor clicks play. No doubleclick.net cookies are set in this mode.
  • Limitation: Once the visitor clicks play, YouTube's standard cookies are set and viewing data is transmitted to Google. The privacy enhancement only delays tracking until interaction.

Consent & Compliance

YouTube Player falls under both functional and marketing consent categories.

Under GDPR and ePrivacy, standard YouTube embeds require consent because they set third-party cookies (including the IDE cookie on doubleclick.net for cross-site ad targeting) on page load — before any user interaction. This constitutes storage of non-essential information on the user's device under the ePrivacy Directive. Several EU DPAs have addressed YouTube embeds specifically, noting that they transmit personal data (IP address, viewing behavior) to Google without a valid legal basis if loaded without consent. The privacy-enhanced mode (youtube-nocookie.com) defers cookie setting until playback but does not eliminate the consent requirement, as viewing data is still transmitted to Google once the video plays.

Under CCPA/CPRA, the sharing of viewer data with Google's advertising platform through the doubleclick.net cookie and ad targeting infrastructure constitutes "sharing" of personal information for cross-context behavioral advertising. The viewer's IP address, video interactions, and derived interest data are processed by Google for ad targeting across its network.

Should You Block This Without Consent?

Conditional. Standard YouTube embeds (youtube.com) set tracking cookies on page load and should be blocked until consent is obtained. Replace them with a static thumbnail image and a play button that loads the actual embed after the user clicks (facade pattern). Using youtube-nocookie.com is a partial improvement but still requires consent for the marketing components. For a purely functional video display, consider using the privacy-enhanced embed with a click-to-load facade as the minimum acceptable implementation.

Visit website

Consent Categories

Functional
Marketing

Also Known As

youtube embed cookiesyoutube player trackingyoutube iframe privacyyoutube embed consentgoogle video embed cookies

Industries

Computers Electronics and Technology

Frequently Asked Questions

Is consent required for YouTube Player embeds?

Conditional. Standard youtube.com embeds set the IDE cookie on doubleclick.net for ad targeting on page load — requiring consent. Use youtube-nocookie.com to avoid pre-consent cookies. A click-to-load facade is best practice for full compliance.

What does the YouTube Player track?

Standard embeds set VISITOR_INFO1_LIVE (6-month), YSC (session), GPS (30-min), and IDE on doubleclick.net (13-month ad cookie). Watch duration, play/pause events, page URL, IP address, and ad impressions are sent to Google and DoubleClick.

How does ConsentStack block YouTube Player?

ConsentStack places YouTube Player in both functional and marketing categories. Standard youtube.com iframes are blocked until consent is obtained. Using youtube-nocookie.com with a click-to-load facade is the recommended ConsentStack-compatible approach.

Other Google Products

Firebase
Firebase
Firebase is Google's mobile and web application development platform offering authentication, real-time database, cloud functions, and analytics. Web SDK scripts initialize Firebase services and may track app events via Firebase Analytics, which is powered by Google Analytics 4. Widely used in single-page apps and PWAs for backend infrastructure and usage tracking.
Google Ads
Google Ads
Google Ads is Google's advertising platform for search, display, and remarketing campaigns. Conversion tracking scripts fire on advertiser landing pages to measure actions taken after ad clicks. The remarketing tag builds audience lists for retargeting users across Google's ad network.
Google Analytics
Google Analytics
Google Analytics is the world's most widely deployed web analytics platform. Scripts track page views, sessions, user demographics, traffic sources, and conversion events. Drops cookies to identify returning visitors and attribute user journeys across sessions.
Google Fonts
Google Fonts
Google Fonts is a free font hosting service that serves hundreds of typeface families via a global CDN. Stylesheets and font files load from fonts.googleapis.com and fonts.gstatic.com to deliver web fonts to visitors. No advertising or tracking functionality is included.
Google Maps
Google Maps
Google Maps is the dominant web mapping service used for embedded maps and location features on websites. Scripts load interactive map tiles, geocoding, and Places API functionality through the Maps JavaScript API. May set cookies to remember map preferences and manage API quota.
Google Tag Manager
Google Tag Manager
Google Tag Manager is a tag management system that lets marketers deploy and update analytics and marketing scripts without code changes. The GTM container script loads synchronously in the page head and injects configured tags, triggers, and variables on behalf of other vendors. No data collection of its own — acts as a loader for other scripts.
reCAPTCHA
reCAPTCHA
Google reCAPTCHA is a bot detection and spam prevention service protecting web forms, login pages, and checkout flows. Scripts analyze user behavior, mouse movements, and browser fingerprints to distinguish humans from bots. The invisible reCAPTCHA v3 scores interactions without requiring user challenges.
YouTube
YouTube
YouTube is Google's video platform, widely used to embed video content on external websites. The YouTube iframe player loads JavaScript that communicates with Google's servers for video playback, quality control, and ad serving. Embedded players may set cookies tied to the viewer's Google account to track watch history and personalize recommendations.
Google Search
Google Search
Google Search appears on websites through the Programmable Search Engine, enabling custom site-specific search functionality. Scripts load the search widget from Google's servers to render search bars and display results within the host website. Sends search queries to Google's index and may set cookies for search personalization and query history.

Related Vendors

Google Maps
Google Maps
Google Maps is the dominant web mapping service used for embedded maps and location features on websites. Scripts load interactive map tiles, geocoding, and Places API functionality through the Maps JavaScript API. May set cookies to remember map preferences and manage API quota.
Google Search
Google Search
Google Search appears on websites through the Programmable Search Engine, enabling custom site-specific search functionality. Scripts load the search widget from Google's servers to render search bars and display results within the host website. Sends search queries to Google's index and may set cookies for search personalization and query history.
Google
Google
Google is the dominant provider of web analytics, advertising, and infrastructure tools. Scripts like Google Analytics, Tag Manager, Ads, and reCAPTCHA collect behavioral data, manage tag firing, serve targeted ads, and detect bots. Sets persistent cookies to track users and correlate activity across sites.
Microsoft Teams
Microsoft Teams
Microsoft Teams is a workplace communication and collaboration platform that can be embedded on websites for chat, meetings, and document sharing. Embedded widgets load from Microsoft's servers to enable real-time messaging, video calls, and file collaboration. Sets authentication and session cookies to verify participant identity and maintain connection state.
Apple Maps JS
Apple Maps JS
Apple Maps JS is Apple's JavaScript mapping framework for embedding interactive maps on websites. Scripts load map tiles, location pins, and routing data from Apple's MapKit servers to render navigable maps within web pages. Requires a MapKit JS token for authentication but does not set tracking cookies or collect behavioral analytics data.
Apple Business Chat
Apple Business Chat
Apple Business Chat enables direct customer messaging between websites and Apple's Messages app. Scripts load chat buttons and conversation interfaces that connect visitors to business support agents through iMessage. Sets minimal session cookies to maintain conversation context but does not track browsing behavior or collect analytics data.

Manage consent for YouTube Player

ConsentStack automatically detects and manages YouTube Player trackers so your site stays compliant with global privacy regulations.