데이터 제외 만들기

데이터 제외는 계정의 전환 추적에 문제가 발생한 날짜의 모든 데이터를 무시하도록 스마트 자동 입찰에 알리는 데 사용할 수 있는 고급 도구입니다. 데이터 제외 작동 방식에 대한 자세한 내용은 데이터 제외 도움말 페이지를 참고하세요.

BiddingDataExclusions를 사용하여 프로그래매틱 방식으로 데이터 제외를 만듭니다. 관리자 계정에서는 BiddingDataExclusions를 설정할 수 없고 캠페인 수준에서만 설정할 수 있습니다.

범위

BiddingDataExclusions에는 다음 값으로 설정할 수 있는 필수 scope이 있습니다. 추가 범위별 구성 옵션은 사용되는 범위에 따라 설정됩니다.

  • CAMPAIGN - 제외가 특정 캠페인에 적용됩니다. 이 제외가 적용될 캠페인 리소스 이름 목록으로 campaigns 필드를 설정합니다.
    • BiddingDataExclusion당 최대 캠페인 수는 2,000개입니다.
  • CHANNEL - 제외가 특정 채널 유형에 속하는 캠페인에 적용됩니다. advertising_channel_types 필드를 이 제외가 적용될 AdvertisingChannelTypes 목록으로 설정합니다.

기기

범위 외에도 제외가 적용될 기기 유형의 선택적 목록을 사용하여 데이터 제외를 구성할 수 있습니다. devices이 설정된 경우 지정된 기기 유형의 전환 데이터만 제외됩니다. 지정하지 않으면 모든 기기 유형의 전환 데이터가 제외됩니다.

날짜 및 시간

범위와 선택적 기기를 제외하고 각 데이터 제외에는 시작일과 종료일 및 시간이 있어야 합니다. 데이터 제외는 과거를 되돌아보며 과거에 start_date_time이 있고 과거 또는 미래에 end_date_time이 있는 이벤트에 사용해야 합니다. 시간은 계정의 시간대로 표시됩니다.

한도

입찰 데이터 제외를 사용할 때는 다음 한도에 유의하세요.

  • 범위가 CAMPAIGN로 설정된 경우 단일 BiddingDataExclusion는 최대 2,000개의 캠페인에 적용될 수 있습니다.
  • 관리자 계정 및 테스트 계정을 포함한 각 고객 계정은 한 번에 최대 500개의 활성 입찰 데이터 제외를 가질 수 있습니다. 이 한도를 초과하면 RESOURCE_LIMIT 오류가 발생합니다.

다음 예에서는 CHANNEL 범위로 데이터 제외를 만드는 방법을 보여줍니다. 주석 처리된 섹션은 대신 CAMPAIGN 범위를 설정하는 경우 캠페인을 지정하는 방법을 보여줍니다.

자바

BiddingDataExclusion DataExclusion =
    BiddingDataExclusion.newBuilder()
        // A unique name is required for every data exclusion.
        .setName("Data exclusion #" + getPrintableDateTime())
        // The CHANNEL scope applies the data exclusion to all campaigns of specific
        // advertising channel types. In this example, the exclusion will only apply to
        // Search campaigns. Use the CAMPAIGN scope to instead limit the scope to specific
        // campaigns.
        .setScope(SeasonalityEventScope.CHANNEL)
        .addAdvertisingChannelTypes(AdvertisingChannelType.SEARCH)
        // If setting scope CAMPAIGN, add individual campaign resource name(s) according to
        // the commented out line below.
        // .addCampaigns("INSERT_CAMPAIGN_RESOURCE_NAME_HERE")
        .setStartDateTime(startDateTime)
        .setEndDateTime(endDateTime)
        .build();

BiddingDataExclusionOperation operation =
    BiddingDataExclusionOperation.newBuilder().setCreate(DataExclusion).build();

MutateBiddingDataExclusionsResponse response =
    DataExclusionServiceClient.mutateBiddingDataExclusions(
        customerId.toString(), ImmutableList.of(operation));
System.out.printf(
    "Added data exclusion with resource name: %s%n",
    response.getResults(0).getResourceName());
      

C#

BiddingDataExclusion dataExclusion = new BiddingDataExclusion()
{
    // A unique name is required for every data exclusion.
    Name = "Data exclusion #" + ExampleUtilities.GetRandomString(),
    // The CHANNEL scope applies the data exclusion to all campaigns of specific
    // advertising channel types. In this example, the the exclusion will only apply to
    // Search campaigns. Use the CAMPAIGN scope to instead limit the scope to specific
    // campaigns.
    Scope = SeasonalityEventScope.Channel,
    AdvertisingChannelTypes = { AdvertisingChannelType.Search },
    // The date range should be less than 14 days.
    StartDateTime = startDateTime,
    EndDateTime = endDateTime,
};
BiddingDataExclusionOperation operation = new BiddingDataExclusionOperation()
{
    Create = dataExclusion
};

try
{
    MutateBiddingDataExclusionsResponse response =
        biddingDataExclusionService.MutateBiddingDataExclusions(
            customerId.ToString(), new[] { operation });
    Console.WriteLine($"Added data exclusion with resource name: " +
        $"{response.Results[0].ResourceName}");
}
catch (GoogleAdsException e)
{
    Console.WriteLine("Failure:");
    Console.WriteLine($"Message: {e.Message}");
    Console.WriteLine($"Failure: {e.Failure}");
    Console.WriteLine($"Request ID: {e.RequestId}");
    throw;
}
      

PHP

// Creates a bidding data exclusion.
$dataExclusion = new BiddingDataExclusion([
    // A unique name is required for every data exclusion.
    'name' => 'Data exclusion #' . Helper::getPrintableDatetime(),
    // The CHANNEL scope applies the data exclusion to all campaigns of specific
    // advertising channel types. In this example, the exclusion will only apply to
    // Search campaigns. Use the CAMPAIGN scope to instead limit the scope to specific
    // campaigns.
    'scope' => SeasonalityEventScope::CHANNEL,
    'advertising_channel_types' => [AdvertisingChannelType::SEARCH],
    // If setting scope CAMPAIGN, add individual campaign resource name(s) according to
    // the commented out line below.
    // 'campaigns' => ['INSERT_CAMPAIGN_RESOURCE_NAME_HERE'],
    'start_date_time' => $startDateTime,
    'end_date_time' => $endDateTime
]);

// Creates a bidding data exclusion operation.
$biddingDataExclusionOperation = new BiddingDataExclusionOperation();
$biddingDataExclusionOperation->setCreate($dataExclusion);

// Submits the bidding data exclusion operation to add the bidding data exclusion.
$biddingDataExclusionServiceClient =
    $googleAdsClient->getBiddingDataExclusionServiceClient();
$response = $biddingDataExclusionServiceClient->mutateBiddingDataExclusions(
    MutateBiddingDataExclusionsRequest::build($customerId, [$biddingDataExclusionOperation])
);

printf(
    "Added bidding data exclusion with resource name: '%s'.%s",
    $response->getResults()[0]->getResourceName(),
    PHP_EOL
);
      

Python

bidding_data_exclusion_service: BiddingDataExclusionServiceClient = (
    client.get_service("BiddingDataExclusionService")
)
operation: BiddingDataExclusionOperation = client.get_type(
    "BiddingDataExclusionOperation"
)
bidding_data_exclusion: BiddingDataExclusion = operation.create
# A unique name is required for every data exclusion
bidding_data_exclusion.name = f"Data exclusion #{uuid4()}"
# The CHANNEL scope applies the data exclusion to all campaigns of specific
# advertising channel types. In this example, the exclusion will only
# apply to Search campaigns. Use the CAMPAIGN scope to instead limit the
# scope to specific campaigns.
bidding_data_exclusion.scope = (
    client.enums.SeasonalityEventScopeEnum.CHANNEL
)
bidding_data_exclusion.advertising_channel_types.append(
    client.enums.AdvertisingChannelTypeEnum.SEARCH
)
# If setting scope CAMPAIGN, add individual campaign resource name(s)
# according to the commented out line below.
#
# bidding_data_exclusion.campaigns.append(
#     "INSERT_CAMPAIGN_RESOURCE_NAME_HERE"
# )

bidding_data_exclusion.start_date_time = start_date_time
bidding_data_exclusion.end_date_time = end_date_time

response: MutateBiddingDataExclusionsResponse = (
    bidding_data_exclusion_service.mutate_bidding_data_exclusions(
        customer_id=customer_id, operations=[operation]
    )
)

resource_name: str = response.results[0].resource_name

print(f"Added data exclusion with resource name: '{resource_name}'")
      

Ruby

client = Google::Ads::GoogleAds::GoogleAdsClient.new

operation = client.operation.create_resource.bidding_data_exclusion do |bda|
  # A unique name is required for every data excluseion.
  bda.name = "Seasonality Adjustment #{(Time.new.to_f * 1000).to_i}"

  # The CHANNEL scope applies the data exclusion to all campaigns of specific
  # advertising channel types. In this example, the conversion_rate_modifier
  # will only apply to Search campaigns. Use the CAMPAIGN scope to instead
  # limit the scope to specific campaigns.
  bda.scope = :CHANNEL
  bda.advertising_channel_types << :SEARCH

  # If setting scope CAMPAIGN, add individual campaign resource name(s)
  # according to the commented out line below.
  #
  # bda.campaigns << "INSERT_CAMPAIGN_RESOURCE_NAME_HERE"

  bda.start_date_time = start_date_time
  bda.end_date_time = end_date_time
end

response = client.service.bidding_data_exclusion.mutate_bidding_data_exclusions(
  customer_id: customer_id,
  operations: [operation],
)

puts "Added data exclusion with resource name #{response.results.first.resource_name}."
      

Perl

my $data_exclusion =
  Google::Ads::GoogleAds::V23::Resources::BiddingDataExclusion->new({
    # A unique name is required for every data exclusion.
    name => "Data exclusion #" . uniqid(),
    # The CHANNEL scope applies the data exclusion to all campaigns of specific
    # advertising channel types. In this example, the exclusion will only apply
    # to Search campaigns. Use the CAMPAIGN scope to instead limit the scope to
    # specific campaigns.
    scope                   => CHANNEL,
    advertisingChannelTypes => [SEARCH],
    # If setting scope CAMPAIGN, add individual campaign resource name(s)
    # according to the commented out line below.
    # campaigns     => ["INSERT_CAMPAIGN_RESOURCE_NAME_HERE"],
    startDateTime => $start_date_time,
    endDateTime   => $end_date_time
  });

my $operation =
  Google::Ads::GoogleAds::V23::Services::BiddingDataExclusionService::BiddingDataExclusionOperation
  ->new({
    create => $data_exclusion
  });

my $response = $api_client->BiddingDataExclusionService()->mutate({
    customerId => $customer_id,
    operations => [$operation]});

printf "Added data exclusion with resource name: '%s'.\n",
  $response->{results}[0]{resourceName};
      

curl