ターゲット設定

リソース ターゲティングの管理は、ディスプレイ &ビデオ 360 のVideo 360 API。 ターゲティングは複数のリソースタイプに割り当てることができ、さまざまなリソース タイプを利用できます。 リソースと ID 空間が含まれます。このページでは、注意すべき制限と推奨される制限事項について説明します。 導入すべきベスト プラクティスをいくつか紹介します。Video 360 API の割り当て済みターゲティング オプション サービス。

ターゲティングの継承を活用する

一部のリソースに割り当てられたターゲティングを子に継承できる 説明します。子リソースに継承されたターゲティング オプションは取得可能ですが、 子リソースレベルでは編集できません。これによりブランド保護設定が有効になり パートナーまたは広告主の全体に適用できる他のターゲティングを設定できます。

次の図に継承の経路を示します。

ターゲティングの継承図

図に示されているように、一部のターゲティング レベルでは、 さまざまなタイプのターゲティングに利用できます。そのため、一部のターゲティング オプションを 継承されますが、代わりに下位レベルで設定する必要があります。

YouTube での継承とパートナー様向けリソース

ターゲティングの継承が YouTube とGoogle Cloud のパートナー様向けリソース ディスプレイとVideo 360 API。広告グループによって継承されたターゲティングは、 AdGroup レベルでの取得可能、および YouTube ターゲティング 子リソースに継承されません。

広告グループの機能ターゲティング設定をすべて取得するには、 広告グループに割り当てられているターゲティング オプションを取得し、 親広告申込情報、親広告主

広告申込情報の作成時に割り当てるターゲティングに注意する

継承されたターゲティング オプションを除き、ほとんどのターゲティングは 広告申込情報の作成後に変更することはできませんただし 一部のターゲティングタイプは 広告申込情報の作成時に広告申込情報に割り当てられる値のデフォルトのサブセットこれら ターゲティング タイプは次のとおりです。

割り当て済みの既存のターゲティング オプションを作成したり、既存ではないターゲティング オプションを削除したりしようとしている エラーが返されるため、フルバージョンのターゲット設定を 広告申込情報の作成時に自動的に割り当てられますメッセージを取得する必要がある場合、 複数のターゲティング タイプを同じ広告申込情報に割り当てている場合、 advertisers.lineItems.bulkListAssignedTargetingOptions

また、一部の設定は、その項目でターゲット設定オプションがない場合に、 リソースに割り当てられます。たとえば、リソースに割り当てられていない TARGETING_TYPE_AUTHORIZED_SELLER_STATUS ターゲティング オプションが定義されている場合、 販売者と販売パートナー」ステータスです。

自動の「デフォルトのターゲティング」は想定されない

ディスプレイ &ビデオ 360 で動画 360 の場合、キャンペーンまたは広告掲載オーダーのレベルで設定されたターゲティング: 子広告申込情報にはすぐに渡されませんこのターゲティングは デフォルトのターゲティングターゲティングテンプレートとして使用され 後で UI で作成する広告申込情報に適用できる。

ディスプレイ &ビデオ 360 でVideo 360 API です。デフォルトのターゲティングは新しく 作成済みの広告申込情報が表示されます基本的な広告申込情報を作成しても、どのキャンペーンにもコピーされません または広告掲載オーダーレベルの ターゲティングを設定できますこの場合、目的のターゲティングは 割り当てられたターゲティング オプションを通じて広告申込情報に個別に適用される create メソッドまたは 一括編集メソッドを使用します。

特殊なメソッドは例外となる場合があります。たとえば、 advertisers.lineItems.generateDefault コピー 割り当てられているターゲティングを含む、親広告掲載オーダーの設定が表示されます。 同様に、複製で作成された広告申込情報には、 元の広告申込情報と同じターゲティングを 設定することをおすすめします

YouTube /パートナーのターゲティングは変更できません

YouTube とパートナーのキャンペーンは、 ディスプレイとVideo 360 API。

YouTube /パートナーのターゲティングは、 YouTube /広告グループ、パートナーの広告申込情報、 以下のターゲティング タイプのすべてのターゲティング:

  • TARGETING_TYPE_SESSION_POSITION
  • TARGETING_TYPE_YOUTUBE_CHANNEL
  • TARGETING_TYPE_YOUTUBE_VIDEO

このターゲティングは、ディスプレイ &ビデオ 360 の動画 360 の UI を直接、または 構造化データファイルのアップロードをご覧ください。

1 つのオプションでオーディエンス ターゲティングを割り当てる

ほとんどのターゲティング タイプのターゲティング オプションは、それぞれ個別に割り当てられます。視聴者 グループ ターゲティングは、このモジュール式の規約に従わず、 単一の構成可能な オーディエンス グループ ターゲティングの詳細オブジェクト。 広告配信時に追加または除外するオーディエンスの ID。「 このオーディエンス グループ オプションには assignedTargetingOptionId、 常に「audienceGroup」になります

この設計では、オーディエンス グループのターゲティングを変更する場合は、 まず、割り当てられている既存のオーディエンス グループを削除します。 新しいオーディエンス グループを作成する 変更することもできます。これは 1 つのリクエストで advertisers.lineItems.bulkEditAssignedTargetingOptions

オーディエンス ターゲティングを更新して、 追加の Google オーディエンスをターゲットに設定する:

Java

long advertiserId = advertiser-id;
long lineItemId = line-item-id
List<Long> addedGoogleAudienceIds =
    Arrays.asList(google-audience-id-to-add,...);

// Build Google audience targeting settings objects to add to audience
// targeting.
ArrayList<GoogleAudienceTargetingSetting> newGoogleAudienceSettings =
    new ArrayList<GoogleAudienceTargetingSetting>();

// Convert list of Google Audience IDs into list of settings.
for (Long googleAudienceId : addedGoogleAudienceIds) {
  newGoogleAudienceSettings.add(new GoogleAudienceTargetingSetting()
      .setGoogleAudienceId(googleAudienceId));
}

// Create relevant bulk edit request objects.
BulkEditLineItemAssignedTargetingOptionsRequest requestContent =
    new BulkEditLineItemAssignedTargetingOptionsRequest();
AudienceGroupAssignedTargetingOptionDetails updatedAudienceGroupDetails;
ArrayList<DeleteAssignedTargetingOptionsRequest> audienceGroupDeleteRequests =
    new ArrayList<DeleteAssignedTargetingOptionsRequest>();

try {
  // Retrieve existing audience group targeting.
  AssignedTargetingOption existingAudienceGroupTargetingOption =
      service
          .advertisers()
          .lineItems()
          .targetingTypes()
          .assignedTargetingOptions()
          .get(
              advertiserId,
              lineItemId,
              "TARGETING_TYPE_AUDIENCE_GROUP",
              "audienceGroup"
          ).execute();

  // Extract existing audience group targeting details.
  updatedAudienceGroupDetails =
      existingAudienceGroupTargetingOption.getAudienceGroupDetails();

  // Build and add delete request for existing audience group targeting.
  ArrayList<String> deleteAudienceGroupAssignedTargetingIds =
      new ArrayList<String>();
  deleteAudienceGroupAssignedTargetingIds.add("audienceGroup");

  audienceGroupDeleteRequests
      .add(new DeleteAssignedTargetingOptionsRequest()
          .setTargetingType("TARGETING_TYPE_AUDIENCE_GROUP")
          .setAssignedTargetingOptionIds(
              deleteAudienceGroupAssignedTargetingIds
          )
      );
}
catch (GoogleJsonResponseException e) {
  updatedAudienceGroupDetails =
      new AudienceGroupAssignedTargetingOptionDetails();
}

// Set delete requests in edit request.
requestContent.setDeleteRequests(audienceGroupDeleteRequests);

// Construct new group of Google Audiences to include in targeting.
GoogleAudienceGroup updatedIncludedGoogleAudienceGroup =
    updatedAudienceGroupDetails.getIncludedGoogleAudienceGroup();
if (updatedIncludedGoogleAudienceGroup != null) {
  List<GoogleAudienceTargetingSetting> updatedGoogleAudienceSettings =
      updatedIncludedGoogleAudienceGroup.getSettings();
  updatedGoogleAudienceSettings.addAll(newGoogleAudienceSettings);
  updatedIncludedGoogleAudienceGroup
      .setSettings(updatedGoogleAudienceSettings);
} else {
  updatedIncludedGoogleAudienceGroup = new GoogleAudienceGroup();
  updatedIncludedGoogleAudienceGroup.setSettings(newGoogleAudienceSettings);
}

// Add new Google Audience group to audience group targeting details.
updatedAudienceGroupDetails
    .setIncludedGoogleAudienceGroup(updatedIncludedGoogleAudienceGroup);

// Create new targeting option to assign.
AssignedTargetingOption newAudienceGroupTargeting =
    new AssignedTargetingOption();
newAudienceGroupTargeting
    .setAudienceGroupDetails(updatedAudienceGroupDetails);

// Build audience group targeting create request and add to list of create
// requests.
ArrayList<AssignedTargetingOption> createAudienceGroupAssignedTargetingOptions =
    new ArrayList<AssignedTargetingOption>();
createAudienceGroupAssignedTargetingOptions.add(newAudienceGroupTargeting);
ArrayList<CreateAssignedTargetingOptionsRequest> targetingCreateRequests =
    new ArrayList<CreateAssignedTargetingOptionsRequest>();
targetingCreateRequests.add(new CreateAssignedTargetingOptionsRequest()
    .setTargetingType("TARGETING_TYPE_AUDIENCE_GROUP")
    .setAssignedTargetingOptions(
        createAudienceGroupAssignedTargetingOptions
    )
);

// Set create requests in edit request.
requestContent.setCreateRequests(targetingCreateRequests);

// Configure and execute the bulk list request.
BulkEditLineItemAssignedTargetingOptionsResponse response =
    service.advertisers().lineItems()
        .bulkEditLineItemAssignedTargetingOptions(
            advertiserId,
            lineItemId,
            requestContent).execute();

Python

advertiser_id = advertiser-id
line_item_id = line-item-id
added_google_audiences = [google-audience-id-to-add,...]

# Build Google audience targeting settings objects to create.
new_google_audience_targeting_settings = []
for google_audience_id in added_google_audiences:
 new_google_audience_targeting_settings.append(
     {'googleAudienceId': google_audience_id}
 )

# Retrieve any existing line item audience targeting.
retrieved_audience_targeting = service.advertisers().lineItems(
).targetingTypes().assignedTargetingOptions().get(
   advertiserId=advertiser_id,
   lineItemId=line_item_id,
   targetingType="TARGETING_TYPE_AUDIENCE_GROUP",
   assignedTargetingOptionId="audienceGroup"
).execute()

updated_audience_group_details = {}

# Copy over any existing audience targeting.
if 'audienceGroupDetails' in retrieved_audience_targeting:
 updated_audience_group_details = retrieved_audience_targeting[
     'audienceGroupDetails']

# Append the new Google audience IDs to any existing positive Google
# audience targeting.
if 'includedGoogleAudienceGroup' in updated_audience_group_details:
 updated_audience_group_details[
     'includedGoogleAudienceGroup']['settings'].extend(
         new_google_audience_targeting_settings)
else:
 updated_audience_group_details['includedGoogleAudienceGroup'] = {
     'settings': new_google_audience_targeting_settings
 }

# Build bulk edit request.
bulk_edit_request = {
   'deleteRequests': [
       {
         'targetingType': "TARGETING_TYPE_AUDIENCE_GROUP",
         'assignedTargetingOptionIds': [
           "audienceGroup"
         ]
       }
   ],
   'createRequests': [
       {
           'targetingType': "TARGETING_TYPE_AUDIENCE_GROUP",
           'assignedTargetingOptions': [
               {'audienceGroupDetails': updated_audience_group_details}
           ]
       }
   ]
}

# Update the audience targeting
updated_audience_targeting = service.advertisers().lineItems(
).bulkEditLineItemAssignedTargetingOptions(
   advertiserId=advertiser_id,
   lineItemId=line_item_id,
   body=bulk_edit_request
).execute()

PHP

$advertiserId = advertiser-id;
$lineItemId = line-item-id;
$addedGoogleAudienceIds = array(google-audience-id-to-add,...);

// Convert list of Google Audience IDs into list of Google audience
// settings.
$newGoogleAudienceSettings = array();
foreach ($addedGoogleAudienceIds as $googleAudienceId) {
    $newSetting =
        new Google_Service_DisplayVideo_GoogleAudienceTargetingSetting();
    $newSetting->setGoogleAudienceId($googleAudienceId);
    $newGoogleAudienceSettings[] = $newSetting;
}

// Create a bulk edit request.
$requestBody =
    new Google_Service_DisplayVideo_BulkEditLineItemAssignedTargetingOptionsRequest();

$audienceGroupDeleteRequests = array();

try {
    // Retrieve existing audience group targeting.
    $existingAudienceGroupTargetingOption = $this
        ->service
        ->advertisers_lineItems_targetingTypes_assignedTargetingOptions
        ->get(
            $advertiserId,
            $lineItemId,
            'TARGETING_TYPE_AUDIENCE_GROUP',
            'audienceGroup'
        );

    // Extract existing audience group targeting details.
    $updatedAudienceGroupDetails =
        $existingAudienceGroupTargetingOption
            ->getAudienceGroupDetails();

    // Build and add delete request for existing audience group
    // targeting.
    $deleteAudienceGroupAssignedTargetingIds = array();
    $deleteAudienceGroupAssignedTargetingIds[] = "audienceGroup";

    $audienceGroupDeleteRequest =
        new Google_Service_DisplayVideo_DeleteAssignedTargetingOptionsRequest();
    $audienceGroupDeleteRequest
        ->setTargetingType('TARGETING_TYPE_AUDIENCE_GROUP');
    $audienceGroupDeleteRequest
        ->setAssignedTargetingOptionIds(
            $deleteAudienceGroupAssignedTargetingIds
        );
    $audienceGroupDeleteRequests[] = $audienceGroupDeleteRequest;
} catch (\Exception $e) {
    $updatedAudienceGroupDetails =
        new Google_Service_DisplayVideo_AudienceGroupAssignedTargetingOptionDetails();
}

// Set delete requests in edit request.
$requestBody->setDeleteRequests($audienceGroupDeleteRequests);

// Construct new group of Google audiences to include in targeting.
$updatedIncludedGoogleAudienceGroup = $updatedAudienceGroupDetails
    ->getIncludedGoogleAudienceGroup();

if (!empty($updatedIncludedGoogleAudienceGroup)) {
    // Get existing settings.
    $updatedGoogleAudienceSettings =
    $updatedIncludedGoogleAudienceGroup->getSettings();

    // Add new Google audiences to existing list.
    $updatedGoogleAudienceSettings = array_merge(
        $updatedGoogleAudienceSettings,
        $newGoogleAudienceSettings
    );

    // Set updated Google audience list.
    $updatedIncludedGoogleAudienceGroup
        ->setSettings($updatedGoogleAudienceSettings);
} else {
    // Create new Google audience group.
    $updatedIncludedGoogleAudienceGroup =
        new Google_Service_DisplayVideo_GoogleAudienceGroup();

    // Set list of new Google audiences for targeting.
    $updatedIncludedGoogleAudienceGroup
        ->setSettings($newGoogleAudienceSettings);
}

// Add new Google Audience group to audience group targeting details.
$updatedAudienceGroupDetails
    ->setIncludedGoogleAudienceGroup(
        $updatedIncludedGoogleAudienceGroup
    );

// Create new targeting option to assign.
$newAudienceGroupTargeting =
    new Google_Service_DisplayVideo_AssignedTargetingOption();
$newAudienceGroupTargeting
    ->setAudienceGroupDetails($updatedAudienceGroupDetails);

// Build audience group targeting create request and add to list of
// create requests.
$createAudienceGroupAssignedTargetingOptions = array();
$createAudienceGroupAssignedTargetingOptions[] =
    $newAudienceGroupTargeting;
$createAudienceGroupTargetingRequest =
    new Google_Service_DisplayVideo_CreateAssignedTargetingOptionsRequest();
$createAudienceGroupTargetingRequest->setTargetingType(
    "TARGETING_TYPE_AUDIENCE_GROUP"
);
$createAudienceGroupTargetingRequest->setAssignedTargetingOptions(
    $createAudienceGroupAssignedTargetingOptions
);
$createRequests[] = $createAudienceGroupTargetingRequest;

// Set create requests in edit request.
$requestBody->setCreateRequests($createRequests);

// Call the API, editing the assigned targeting options for the
// identified line item.
$response = $this
    ->service
    ->advertisers_lineItems
    ->bulkEditLineItemAssignedTargetingOptions(
        $advertiserId,
        $lineItemId,
        $requestBody
    );

ターゲティング オプションの廃止に備える

ターゲティング オプションは静的なものではなく、少数のオプションは今後廃止される可能性があります。 できます。ターゲティング オプションのサポートが終了すると、広告申込情報の広告に影響しない あります。サポート終了後は、これらのオプションは既存の回線から割り当て解除されます それらのオプションを取得または割り当てようとすると、 表示されます。

このようなエラーを防ぐには、保存済みのデータを定期的にチェックし、 ターゲティング オプション ID。割り当てを節約するために、Google Cloud Storage バケットを よく使用されます。ただし、ID を保存すると、ID を ターゲティングオプションが廃止されたことを 通知しますこのため、 定期的に targetingOptions.targetingTypes.get を使用して、 保存されているすべてのターゲティング オプション ID を取得して、それらが現在も ディスプレイと動画 360

重要な影響については、非推奨化が発表されたページをご覧ください。 サポートを終了しました

同じ広告申込情報を更新するリクエストを同時に行わない

1 つの広告申込情報の設定または割り当て済みのターゲティングを更新しようとしている 複数の同時リクエストを使用するとエラーが返されます。該当するリクエスト 含める:

1 つのキャンペーンに対して複数のターゲティング オプションを割り当てたり削除したりする必要がある場合 1 つの広告ユニットを同時に作成する場合は、1 つの advertisers.lineItems.bulkEditAssignedTargetingOptions リクエストできます。広告申込情報の設定とターゲティングを更新するには、 patch または bulkUpdate リクエストと関連する ターゲティング リクエストを設定して、最初のリクエストが レスポンスが返されます。