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 onyoutube.com(6-month expiry). Estimates bandwidth and determines player interface version.YSC— Third-party cookie onyoutube.com(session). Unique session identifier tracking video views.GPS— Third-party cookie onyoutube.com(30-minute expiry). Stores geographic location for mobile tracking.IDE— Third-party cookie ondoubleclick.net(13-month expiry, 24 hours in EEA). Cross-site ad targeting and conversion attribution.CONSENT— Third-party cookie onyoutube.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.netcookies 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.
Consent Categories
Also Known As
Industries
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
Related Vendors
Manage consent for YouTube Player
ConsentStack automatically detects and manages YouTube Player trackers so your site stays compliant with global privacy regulations.