AdsApp.YouTubeVideoBuilder
    
    
      
      
      Stay organized with collections
     
    
      
      Save and categorize content based on your preferences.
     
   
     
  
  
  
   
  
    
    
  
    
      
  
  
    
      
        outlined_flag 
       
     
    
      
        
          The YouTubeVideoBuilder is used to create YouTubeVideo objects.
         
      
        
          Essential methods include build() to finalize the video criterion and withVideoId() to set the required YouTube video ID.
         
      
        
          You can set bid types using withCpc() and withCpm().
         
      
        
          The exclude() method can be used to build an excluded YouTube video criterion.
         
      
     
   
 
    
    
Builder for 
YouTubeVideo  objects.
Example usage:
var   youTubeVideoBuilder   =   adGroup . display () . newYouTubeVideoBuilder (); 
var   youTubeVideoOperation   =   youTubeVideoBuilder 
   . withVideoId ( '_YUugB4IUl4' )        //   required 
   . build ();                          //   create   the   YouTube   video Methods: 
  
  build()
  Builds the YouTube video criterion. Returns a 
YouTubeVideoOperation  that
corresponds to the creation of the 
YouTubeVideo .  
Return values: 
  
  exclude()
  Builds the excluded YouTube video criterion. Returns an 
ExcludedYouTubeVideoOperation 
that corresponds to the creation of the 
ExcludedYouTubeVideo .  
Return values: 
  
  withCpc(cpc)
  Sets the max CPC bid of the new YouTube video to the specified value.  
Arguments: 
  
    Name Type Description 
      cpc 
      doubleThe max CPC bid of the YouTube video. 
     
  
  Return values: 
  
  withCpm(cpm)
  Sets the CPM bid of the new YouTube video to the specified value.
See Cost-per-thousand
impressions (CPM)  for more information.  
Arguments: 
  
    Name Type Description 
      cpm 
      doubleThe CPM bid of the YouTube video. 
     
  
  Return values: 
  
  withVideoId(videoId)
  Sets the YouTube video ID. This field is required.  
Arguments: 
  
    Name Type Description 
      videoId 
      StringThe YouTube video ID. 
     
  
  Return values: 
  
  
  
     
  
    
      
       
    
    
      
    
     
  
       
    
    
      
 
  Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
  Last updated 2025-10-16 UTC.
 
 
  
  
  
    
      [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-16 UTC."],[],[]]