Video yükleme

YouTubeVideoUploadService Google Ads API aracılığıyla videoları doğrudan YouTube'a yüklemenize olanak tanır. Bu videolar daha sonra Maksimum Performans kampanyaları veya Talep Yaratma kampanyaları gibi çeşitli reklam türlerinde video öğeleri oluşturmak için kullanılabilir.

Bu hizmet, YouTube yükleme sürecini yöneterek video reklam oluşturma iş akışını kolaylaştırır ve videoların hesabınızla doğru şekilde ilişkilendirilmesini sağlar.

Temel kavramlar

Başlamadan önce video yüklemelerinin nasıl yönetildiğini ve geçebilecekleri farklı durumları anlamanız önemlidir.

Uçtan uca iş akışı

Video dosyası yüklemek ve reklamda yayınlamak için dört adımın sırayla uygulanması gerekir:

Adım Hizmet ve yöntem Özet
1. Video baytlarını başlatma ve yükleme CreateYouTubeVideoUpload, YouTubeVideoUploadService hakkında yorum yaptı YouTubeVideoUpload kaynağı (customers/{customer_id}/youTubeVideoUploads/{video_upload_id}) oluşturmak için video meta verilerini ve ikili program dosyasını yükleyin.
2. Anket işleme durumu SearchStream, GoogleAdsService hakkında yorum yaptı you_tube_video_upload sorgusunu state = 'PROCESSED' tarihine kadar çalıştırın ve 11 karakterlik YouTube video_id kimliğiyle doldurun.
3. Yeniden kullanılabilir video öğesi oluşturma MutateAssets, AssetService hakkında yorum yaptı Öğe kaynak adı (customers/{customer_id}/assets/{asset_id}) almak için YoutubeVideoAsset (youtube_video_id = video_id) oluşturun.
4. Öğeyi kampanyalara veya reklamlara bağlama AssetGroupAssetService üzerinde MutateAssetGroupAssets veya AdGroupAdService üzerinde MutateAdGroupAds Öğeyi bir Maksimum Performans AssetGroupAsset (field_type = YOUTUBE_VIDEO) veya Talep Yaratma DemandGenVideoResponsiveAdInfo (videos[].asset) kampanyasına bağlayın.

Kanal sahipliği

Video yüklerken YouTubeVideoUpload kaynağındaki channel_id alanını kullanarak hedef YouTube kanalını belirtebilirsiniz:

  • Reklamverene ait (marka) kanal: Reklamverene ait mevcut bir YouTube kanalının channel_id bilgisini sağlayın. Bu yalnızca kullanıcı kimlik doğrulama akışında desteklenir ve hizmet hesaplarıyla kullanılamaz.
  • Google tarafından yönetilen kanal: channel_id atlanırsa video, Google Ads hesabıyla ilişkili, Google tarafından yönetilen bir YouTube kanalına yüklenir.

Yükleme durumları

YouTube video yükleme işleminin yaşam döngüsü state alanı tarafından izlenir. YouTubeVideoUploadState enum'u aşağıdaki durumları tanımlar:

Eyalet Açıklama
PENDING Video yükleniyor.
UPLOADED Video başarıyla yüklendi ve YouTube tarafından işleniyor.
PROCESSED Video başarıyla işlendi ve kullanıma hazır.
FAILED Yükleme veya işleme başarısız oldu ve tamamlanamıyor.
REJECTED Video, doğrulama veya politika nedenleriyle reddedildi.
UNAVAILABLE Video durumu kullanılamıyor. Video, YouTube'dan kaldırılmış olabilir.

Gizlilik ayarları

video_privacy alanı, yüklenen videoyu kimlerin görebileceğini kontrol eder. YouTubeVideoPrivacy enum'u şunları destekler:

  • PUBLIC: Video, YouTube'daki herkes tarafından izlenebilir. (Yalnızca marka kanalları için izin verilir).
  • UNLISTED: Video aranabilir değildir ancak bağlantıya sahip herkes tarafından görüntülenebilir. Bu, Google tarafından yönetilen kanallar için varsayılan ve tek seçenektir.

Yapay zekayla üretilmiş içerik açıklaması

26. sürümden itibaren, AB Yapay Zeka Yasası gibi düzenlemeler uyarınca reklamverenler, yüklenen video içeriğinin yapay zekayla üretilmiş veya sentetik medya içerip içermediğini açıklayabilir.

YouTubeVideoUpload içindeki video_content_metadata alanı, VideoContentMetadata değerini içerir. İç içe yerleştirilmiş generative_content_disclosure alanını YouTubeVideoUploadGenerativeContentDisclosure enum değerini kullanarak ayarlayın:

Değer Açıklama
NON_GENERATIVE_CONTENT Reklamveren, videonun yapay zeka tarafından üretilmediğini belirtti.
GENERATIVE_CONTENT Reklamveren, videonun yapay zekayla üretildiğini belirtti.

Video yükleme

Video yüklemek için CreateYouTubeVideoUpload yöntemine yönelik çok parçalı bir istek kullanmanız gerekir. İstek, hem yüklemenin meta verilerini hem de video dosyasını içerir.

1. Yükleme işlemini başlatma

Aşağıdaki alanları içeren bir CreateYouTubeVideoUploadRequest oluşturun:

Alan Gereksinim Açıklama ve kısıtlamalar
customer_id Zorunlu 10 haneli Google Ads müşteri kimliği (tire olmadan).
you_tube_video_upload.video_title Zorunlu (INPUT_ONLY, IMMUTABLE) YouTube'a yüklenen videonun başlığı (en fazla 100 karakter; < veya > içeremez).
you_tube_video_upload.video_description İsteğe bağlı (INPUT_ONLY, IMMUTABLE) YouTube'daki videonun açıklaması (en fazla 5.000 karakter; < veya > karakterini içeremez).
you_tube_video_upload.channel_id İsteğe bağlı (IMMUTABLE) Reklamverene ait marka kanalının 24 karakterden oluşan hedef YouTube kanal kimliği (UC ile başlar). Atlanırsa Google tarafından yönetilen bir kanala yüklenir.
you_tube_video_upload.video_privacy İsteğe bağlı (marka kanallarında değiştirilebilir) YouTubeVideoPrivacy ayarı (UNLISTED varsayılan veya reklamverene ait marka kanalları için PUBLIC).
you_tube_video_upload.video_content_metadata İsteğe bağlı (INPUT_ONLY, IMMUTABLE) v26'dan itibaren kullanılabilir: VideoContentMetadata ile generative_content_disclosure, YouTubeVideoUploadGenerativeContentDisclosure değerine (NON_GENERATIVE_CONTENT veya GENERATIVE_CONTENT) ayarlanır.

Bir istemci kitaplığı kullanıyorsanız video dosyanızı ileterek CreateYouTubeVideoUpload yöntemini çağırın. Video yükleme işlemi dahili olarak gerçekleştirilir.

Java

String videoUploadResourceName;
try (YouTubeVideoUploadServiceClient youTubeVideoUploadServiceClient =
    googleAdsClient.getLatestVersion().createYouTubeVideoUploadServiceClient()) {
  YouTubeVideoUpload youTubeVideoUpload =
      YouTubeVideoUpload.newBuilder()
          .setVideoTitle("Test Video")
          .setVideoDescription("Test Video Description")
          .setVideoPrivacy(YouTubeVideoPrivacy.UNLISTED)
          .build();

  CreateYouTubeVideoUploadRequest createUploadRequest =
      CreateYouTubeVideoUploadRequest.newBuilder()
          .setCustomerId(Long.toString(customerId))
          .setYouTubeVideoUpload(youTubeVideoUpload)
          .build();

  CreateYouTubeVideoUploadResponse response =
      youTubeVideoUploadServiceClient.createYouTubeVideoUpload(
          createUploadRequest, () -> new FileInputStream(videoFile), null);

  videoUploadResourceName = response.getResourceName();
  System.out.printf("Created YouTube video upload: %s%n", videoUploadResourceName);
}
      

C#

YouTubeVideoUploadServiceClient ytService = client.GetService(
    Services.V26.YouTubeVideoUploadService);

CreateYouTubeVideoUploadRequest createUploadRequest =
    new CreateYouTubeVideoUploadRequest()
    {
        CustomerId = customerId.ToString(),
        YouTubeVideoUpload = new YouTubeVideoUpload()
        {
            VideoTitle = "Test Video",
            VideoDescription = "Test Video Description",
            VideoPrivacy = YouTubeVideoPrivacy.Unlisted
        }
    };

string videoUploadResourceName;
using (FileStream stream = File.OpenRead(videoFilePath))
{
    ResumableUploadSession<CreateYouTubeVideoUploadRequest, CreateYouTubeVideoUploadResponse> session =
        ytService.CreateYouTubeVideoUpload();
    CreateYouTubeVideoUploadResponse response =
        session.BeginUploadAsync(createUploadRequest, stream).Result;

    videoUploadResourceName = response.ResourceName;
    Console.WriteLine($"Created YouTube video upload: {videoUploadResourceName}");
}
      

PHP

$youTubeVideoUploadServiceClient = $googleAdsClient->getYouTubeVideoUploadServiceClient();

$youTubeVideoUpload = new YouTubeVideoUpload([
    'video_title' => 'Test Video',
    'video_description' => 'Test Video Description',
    'video_privacy' => YouTubeVideoPrivacy::UNLISTED
]);

$createYouTubeVideoUploadRequest = CreateYouTubeVideoUploadRequest::build(
    $customerId,
    $youTubeVideoUpload
);

/** @var ResumableUpload $resumableUpload */
$resumableUpload = $youTubeVideoUploadServiceClient->createYouTubeVideoUpload(
    $createYouTubeVideoUploadRequest
);

$stream = Utils::streamFor(fopen($videoFilePath, 'rb'));
/** @var CreateYouTubeVideoUploadResponse $response */
$response = $resumableUpload->startUpload($stream);

$videoUploadResourceName = $response->getResourceName();
printf("Created YouTube video upload: '%s'%s", $videoUploadResourceName, PHP_EOL);
      

Python

yt_service: YouTubeVideoUploadServiceClient = client.get_service(
    "YouTubeVideoUploadService"
)

create_upload_request: CreateYouTubeVideoUploadRequest = (
    youtube_video_upload_service.CreateYouTubeVideoUploadRequest()
)
create_upload_request.customer_id = customer_id
create_upload_request.you_tube_video_upload.video_title = "Test Video"
create_upload_request.you_tube_video_upload.video_description = (
    "Test Video Description"
)
create_upload_request.you_tube_video_upload.video_privacy = (
    client.enums.YouTubeVideoPrivacyEnum.UNLISTED
)

video_upload_resource_name: str
with open(video_file_path, "rb") as stream:
    response: CreateYouTubeVideoUploadResponse = (
        yt_service.create_you_tube_video_upload(
            stream=stream,
            request=create_upload_request,
            retry=None,
        )
    )
    video_upload_resource_name = response.resource_name
    print(f"Created YouTube video upload: {video_upload_resource_name}")
      

Ruby

video_upload = client.resource.you_tube_video_upload do |v|
  v.video_title = "Test Video"
  v.video_description = "Test Video Description"
  v.video_privacy = :UNLISTED
end

upload = client.service.you_tube_video_upload.create_you_tube_video_upload(
  customer_id: customer_id,
  you_tube_video_upload: video_upload,
)

video_upload_resource_name = nil
File.open(video_file_path, "rb") do |stream|
  response = upload.start(
    stream: stream,
    content_type: "application/octet-stream",
  )
  video_upload_resource_name = response.resource_name
  puts "Created YouTube video upload: #{video_upload_resource_name}"
end
      

Perl

This example is not yet available in Perl; you can take a look at the other languages.
    

curl

# 
# Use the --i curl parameter to capture response headers in the $RESPONSE
# variable.
FILE_SIZE=$(wc -c < "${VIDEO_FILE_NAME}" | tr -d '\r')
RESPONSE=$(curl -i -f -v -s --request POST \
"https://googleads.googleapis.com/resumable/upload/v${API_VERSION}/customers/${CUSTOMER_ID}/youTubeVideoUploads:create" \
--header "Content-Type: application/json" \
--header "login-customer-id: ${MANAGER_CUSTOMER_ID}" \
--header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \
--header "X-Goog-Upload-Protocol: resumable" \
--header "X-Goog-Upload-Command: start" \
--header "X-Goog-Upload-Header-Content-Length: ${FILE_SIZE}" \
--data @- <<EOF
{
  "customer_id": "${CUSTOMER_ID}",
  "you_tube_video_upload": {
    "video_title": "${VIDEO_TITLE}",
    "video_description": "${VIDEO_DESCRIPTION}",
    "video_privacy": "UNLISTED"
  }
}
EOF
)

# Extract the value of the "x-goog-upload-url" header from the HTTP response.
UPLOAD_URL=$(echo "${RESPONSE}" \
  | grep -i '^x-goog-upload-url' \
  | awk '{print $2}' \
  | tr -d '\r')
CHUNK_SIZE=$(echo "${RESPONSE}" \
  | grep -i '^x-goog-upload-chunk-granularity' \
  | awk '{print $2}' \
  | tr -d '\r')
      

REST kullanıyorsanız video yükleme işlemini nasıl yöneteceğiniz aşağıdaki bölümde açıklanmıştır.

2. Videoyu yükleyin.

REST ile yükleme yaparken CreateYouTubeVideoUpload, iki adımlı bir devam ettirilebilir yükleme protokolü kullanır:

  1. Yükleme oturumunu başlatın: POST isteğini CreateYouTubeVideoUpload yükleme uç noktasına (/upload/v26/customers/{customer_id}/youTubeVideoUploads:create) x-goog-upload-command: start ile gönderin (ve isteğe bağlı olarak dosya boyutunu bildirmek için x-goog-upload-header-content-length). Yanıt, x-goog-upload-url HTTP yanıt başlığında yükleme oturumu URL'sini ve beklenen parça boyutu gibi meta verileri döndürür.
  2. Video baytlarını aktarma ve sonlandırma: İkili video yükünü x-goog-upload-command: upload, finalize ile x-goog-upload-url uç noktasına gönderin. Yükleme işlemi tamamlandığında yanıt, oluşturulan resource_name değerini döndürür (customers/{customer_id}/youTubeVideoUploads/{video_upload_id}).

Video yükleme protokolünde kullanılan HTTP başlıklarının tam açıklaması için aşağıdaki kod örneğine bakın:

# Take the first ${CHUNK_SIZE} bytes of the video file and upload them.
head -c ${CHUNK_SIZE} ${VIDEO_FILE_NAME} | curl -i -v -X PUT "${UPLOAD_URL}" \
--header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \
--header "X-Goog-Upload-Offset: 0" \
--header "X-Goog-Upload-Command: upload" \
--header "Content-Length: ${CHUNK_SIZE}" \
--data-binary @-

# Query the status of the upload.
QUERY_RESPONSE=$(curl -i -s -X POST "${UPLOAD_URL}" \
--header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \
--header "X-Goog-Upload-Command: query")

# Extract the value of the "x-goog-upload-size-received" header from the HTTP
# response.
UPLOADED_BYTES=$(echo "${QUERY_RESPONSE}" \
  | grep -i '^x-goog-upload-size-received' \
  | awk '{print $2}' \
  | tr -d '\r')

echo "Uploaded ${UPLOADED_BYTES} bytes."

REMAINING_BYTES=$((FILE_SIZE - UPLOADED_BYTES))
echo "${REMAINING_BYTES} bytes remaining to upload."

FINALIZE_RESPONSE=$(tail -c ${REMAINING_BYTES} ${VIDEO_FILE_NAME} | curl -v -X PUT "${UPLOAD_URL}" \
--header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \
--header "X-Goog-Upload-Offset: ${UPLOADED_BYTES}" \
--header "X-Goog-Upload-Command: upload, finalize" \
--data-binary @-)
UPLOADED_VIDEO_RESOURCE_NAME=$(echo $FINALIZE_RESPONSE | jq -r '.resourceName')
      

3. Video yükleme durumunu alma

Video yüklemeyi başlattıktan sonra, state = 'PROCESSED' (INPUT_ONLY alanları GAQL'de seçilemez) olana kadar you_tube_video_upload kaynağının seçilebilir alanlarını (resource_name, video_upload_id, channel_id, video_id, state ve video_privacy) GAQL ile sorgulayarak işleme durumunu düzenli olarak kontrol edin:

Java

// Retrieve the metadata of the newly uploaded video.
String query =
    String.format(
        "SELECT "
            + "you_tube_video_upload.resource_name, "
            + "you_tube_video_upload.video_id, "
            + "you_tube_video_upload.state "
            + "FROM you_tube_video_upload "
            + "WHERE you_tube_video_upload.resource_name = '%s'",
        videoUploadResourceName);

try (GoogleAdsServiceClient googleAdsServiceClient =
    googleAdsClient.getLatestVersion().createGoogleAdsServiceClient()) {
  SearchGoogleAdsStreamRequest request =
      SearchGoogleAdsStreamRequest.newBuilder()
          .setCustomerId(Long.toString(customerId))
          .setQuery(query)
          .build();

  ServerStream<SearchGoogleAdsStreamResponse> stream =
      googleAdsServiceClient.searchStreamCallable().call(request);

  for (SearchGoogleAdsStreamResponse response : stream) {
    for (GoogleAdsRow googleAdsRow : response.getResultsList()) {
      YouTubeVideoUpload video = googleAdsRow.getYouTubeVideoUpload();
      System.out.printf(
          "Video with ID %s was found in state %s.%n",
          video.getVideoId(), video.getState());
    }
  }
}
      

C#

// Retrieve the metadata of the newly uploaded video.
string query = $@"
    SELECT
      you_tube_video_upload.resource_name,
      you_tube_video_upload.video_id,
      you_tube_video_upload.state
    FROM you_tube_video_upload
    WHERE you_tube_video_upload.resource_name = '{videoUploadResourceName}'";

GoogleAdsServiceClient gaService = client.GetService(
    Services.V26.GoogleAdsService);

gaService.SearchStream(customerId.ToString(), query,
    delegate (SearchGoogleAdsStreamResponse resp)
    {
        foreach (GoogleAdsRow row in resp.Results)
        {
            Console.WriteLine(
                $"Video with ID {row.YouTubeVideoUpload.VideoId} was found in " +
                $"state {row.YouTubeVideoUpload.State}.");
        }
    }
);
      

PHP

// Retrieve the metadata of the newly uploaded video.
$query = sprintf(
    "SELECT you_tube_video_upload.resource_name, "
    . "you_tube_video_upload.video_id, "
    . "you_tube_video_upload.state "
    . "FROM you_tube_video_upload "
    . "WHERE you_tube_video_upload.resource_name = '%s'",
    $videoUploadResourceName
);

$googleAdsServiceClient = $googleAdsClient->getGoogleAdsServiceClient();
$stream = $googleAdsServiceClient->searchStream(
    SearchGoogleAdsStreamRequest::build($customerId, $query)
);

foreach ($stream->iterateAllElements() as $googleAdsRow) {
    /** @var GoogleAdsRow $googleAdsRow */
    printf(
        "Video with ID '%s' was found in state '%s'.%s",
        $googleAdsRow->getYouTubeVideoUpload()->getVideoId(),
        YouTubeVideoUploadState::name($googleAdsRow->getYouTubeVideoUpload()->getState()),
        PHP_EOL
    );
}
      

Python

# Retrieve the metadata of the newly uploaded video.
query: str = f"""
    SELECT
      you_tube_video_upload.resource_name,
      you_tube_video_upload.video_id,
      you_tube_video_upload.state
    FROM you_tube_video_upload
    WHERE you_tube_video_upload.resource_name = '{video_upload_resource_name}'"""

ga_service: GoogleAdsServiceClient = client.get_service("GoogleAdsService")
stream: Iterator[SearchGoogleAdsStreamResponse] = ga_service.search_stream(
    customer_id=customer_id, query=query
)

for row in itertools.chain.from_iterable(batch.results for batch in stream):
    video = row.you_tube_video_upload
    print(
        f"Video with ID {row.you_tube_video_upload.video_id} was found in state {row.you_tube_video_upload.state}."
    )
      

Ruby

# Retrieve the metadata of the newly uploaded video.
query = <<~EOQ
  SELECT
    you_tube_video_upload.resource_name,
    you_tube_video_upload.video_id,
    you_tube_video_upload.state
  FROM you_tube_video_upload
  WHERE you_tube_video_upload.resource_name = '#{video_upload_resource_name}'
EOQ

responses = client.service.google_ads.search_stream(
  customer_id: customer_id,
  query: query,
)

responses.each do |batch|
  batch.results.each do |row|
    puts "Video with ID #{row.you_tube_video_upload.video_id} was found in " \
      "state #{row.you_tube_video_upload.state}."
  end
end
      

Perl

This example is not yet available in Perl; you can take a look at the other languages.
    

curl

curl -i -v -X POST \
"https://qa-prod-googleads.sandbox.googleapis.com/v${API_VERSION}/customers/${CUSTOMER_ID}/googleAds:search" \
--header "Content-Type: application/json" \
  --header "Developer-Token: ${DEVELOPER_TOKEN}" \
  --header "login-customer-id: ${MANAGER_CUSTOMER_ID}" \
  --header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \
  --data @- <<EOF
{
  "query": "SELECT you_tube_video_upload.resource_name, you_tube_video_upload.video_id, you_tube_video_upload.state FROM you_tube_video_upload WHERE you_tube_video_upload.resource_name = '$UPLOADED_VIDEO_RESOURCE_NAME'"
}
EOF
      

Yüklemeleri yönet

Yükleme işlemi tamamlandıktan sonra videoyu video öğesi olarak kullanabilirsiniz.

Yüklenen videoyu kullanma

Bir video PROCESSED durumuna ulaştıktan sonra 11 karakterlik YouTube video kimliğini YouTubeVideoUpload kaynağının video_id alanında bulabilirsiniz.

YoutubeVideoAsset oluşturmak için bu video_id öğesini kullanın ve sonuçtaki öğe kaynak adını (customers/{customer_id}/assets/{asset_id}) kampanyalarınıza veya reklamlarınıza bağlayın: MutateAssets

  1. AssetService.MutateAssets yöntemine youtube_video_id değerini ileterek YoutubeVideoAsset oluşturun:

    POST https://googleads.googleapis.com/v26/customers/{customer_id}/assets:mutate
    {
      "operations": [
        {
          "create": {
            "name": "Product Launch Video",
            "youtubeVideoAsset": {
              "youtubeVideoId": "dQw4w9WgXcQ"
            }
          }
        }
      ]
    }
    
  2. Asset hizmetini AssetGroup veya AdGroupAd hizmetine bağlama:

    • Maksimum Performans: AssetGroupAsset oluşturun. AssetGroupAssetService.MutateAssetGroupAssets field_type, YOUTUBE_VIDEO olarak ayarlanmış olmalıdır:

      POST https://googleads.googleapis.com/v26/customers/{customer_id}/assetGroupAssets:mutate
      {
        "operations": [
          {
            "create": {
              "assetGroup": "customers/{customer_id}/assetGroups/{asset_group_id}",
              "asset": "customers/{customer_id}/assets/{asset_id}",
              "fieldType": "YOUTUBE_VIDEO"
            }
          }
        ]
      }
      
    • Talep Yaratma: AdGroupAdService.MutateAdGroupAds çağrılırken customers/{customer_id}/assets/{asset_id} öğesine videos DemandGenVideoResponsiveAdInfo nesne listesinde referans verin:

      POST https://googleads.googleapis.com/v26/customers/{customer_id}/adGroupAds:mutate
      {
        "operations": [
          {
            "create": {
              "adGroup": "customers/{customer_id}/adGroups/{ad_group_id}",
              "status": "PAUSED",
              "ad": {
                "name": "Demand Gen Video Ad",
                "finalUrls": ["https://www.example.com"],
                "demandGenVideoResponsiveAd": {
                  "videos": [
                    {
                      "asset": "customers/{customer_id}/assets/{asset_id}"
                    }
                  ],
                  "logoImages": [
                    {
                      "asset": "customers/{customer_id}/assets/{logo_asset_id}"
                    }
                  ],
                  "headlines": [
                    {
                      "text": "Example Headline"
                    }
                  ],
                  "longHeadlines": [
                    {
                      "text": "Example Long Headline"
                    }
                  ],
                  "descriptions": [
                    {
                      "text": "Example Description"
                    }
                  ],
                  "businessName": {
                    "text": "Example Business"
                  }
                }
              }
            }
          }
        ]
      }
      
  3. YOUTUBE_VIDEO öğelerini kullanarak mevcut GoogleAdsService.SearchStream öğelerini sorgulayın:

    SELECT
      asset.id,
      asset.resource_name,
      asset.name,
      asset.type,
      asset.youtube_video_asset.youtube_video_id,
      asset.youtube_video_asset.youtube_video_title
    FROM asset
    WHERE asset.type = 'YOUTUBE_VIDEO'
      AND asset.youtube_video_asset.youtube_video_id = '{video_id}'
    

Meta veriyi güncelle

Bu API aracılığıyla yüklenen bir videonun gizlilik ayarını, update_mask parametresi "video_privacy" olarak ayarlanmış UpdateYouTubeVideoUpload yöntemini kullanarak güncelleyebilirsiniz. Oluşturulduktan sonra yalnızca video_privacy alanı (reklamverene ait bir marka kanalına yüklenen videolar için PUBLIC veya UNLISTED) güncellenebilir. video_title, video_description, channel_id ve video_content_metadata alanları değiştirilemez.

Yüklemeleri kaldırma

Google Ads API ile yüklenen videoları silmeniz gerekiyorsa RemoveYouTubeVideoUpload yönteminin resource_names alanına customers/{customer_id}/youTubeVideoUploads/{video_upload_id} kaynak adlarını iletin. Bu işlem, videoyu hem Google Ads öğe kitaplığından hem de YouTube'dan kaldırır.