สร้างการยกเว้นข้อมูล

การยกเว้นข้อมูลเป็นเครื่องมือขั้นสูงที่สามารถใช้เพื่อบอกให้ Smart Bidding ไม่สนใจข้อมูลทั้งหมดนับตั้งแต่วันที่เกิดปัญหากับเครื่องมือวัด Conversion ของบัญชี ดูรายละเอียดเพิ่มเติมเกี่ยวกับวิธีการทำงานของการยกเว้นข้อมูลได้ใน หน้าความช่วยเหลือเกี่ยวกับการยกเว้นข้อมูล

สร้างการยกเว้นข้อมูลแบบเป็นโปรแกรมโดยใช้ BiddingDataExclusions คุณไม่สามารถตั้งค่า BiddingDataExclusions ในบัญชีดูแลจัดการ แต่ตั้งค่าได้ที่ระดับแคมเปญเท่านั้น

ขอบเขต

BiddingDataExclusions ต้องมี scope ซึ่งตั้งค่าเป็น ค่าต่อไปนี้ได้ ระบบจะตั้งค่าตัวเลือกการกำหนดค่าเพิ่มเติมที่เฉพาะเจาะจงตามขอบเขตตามขอบเขตที่ใช้

  • CAMPAIGN - ใช้การยกเว้นกับแคมเปญที่เฉพาะเจาะจง ตั้งค่าฟิลด์ campaigns เป็นรายการชื่อทรัพยากรของแคมเปญที่จะใช้การยกเว้นนี้
    • BiddingDataExclusion แต่ละรายการมีแคมเปญได้สูงสุด 2,000 แคมเปญ
  • CHANNEL - ใช้การยกเว้นกับแคมเปญที่เป็นของประเภทแชแนลที่เฉพาะเจาะจง ตั้งค่าฟิลด์ advertising_channel_types เป็นรายการ AdvertisingChannelTypes ที่จะใช้การยกเว้นนี้

อุปกรณ์

นอกเหนือจากขอบเขตแล้ว คุณยังกำหนดค่าการยกเว้นข้อมูลด้วยรายการประเภทอุปกรณ์ที่ไม่บังคับที่จะใช้การยกเว้นได้ด้วย หากตั้งค่า devices ไว้ ระบบจะยกเว้นเฉพาะ ข้อมูล Conversion จากประเภทอุปกรณ์ที่ระบุ หากไม่ได้ระบุไว้ ระบบจะยกเว้นข้อมูล Conversion จากอุปกรณ์ทุกประเภท

วันที่และเวลา

นอกเหนือจากขอบเขตและอุปกรณ์ที่ไม่บังคับแล้ว การยกเว้นข้อมูลแต่ละรายการต้องมีวันที่และเวลาเริ่มต้นและสิ้นสุด การยกเว้นข้อมูลจะพิจารณาข้อมูลย้อนหลังและควรใช้ กับเหตุการณ์ที่มี start_date_timeใน อดีตและ end_date_time ในอดีตหรืออนาคต เวลาจะอิงตามเขตเวลาของบัญชี

จำกัดสูงสุด

เมื่อใช้การยกเว้นข้อมูลการเสนอราคา โปรดคำนึงถึงขีดจำกัดต่อไปนี้

  • BiddingDataExclusion รายการเดียวใช้ได้กับแคมเปญสูงสุด 2,000 แคมเปญเมื่อตั้งค่าขอบเขตเป็น CAMPAIGN
  • บัญชีลูกค้าแต่ละบัญชี รวมถึงบัญชีดูแลจัดการและบัญชีทดสอบ สามารถมีการยกเว้นข้อมูลการเสนอราคาที่ใช้งานอยู่ได้สูงสุด 500 รายการในเวลาใดก็ตาม หากเกินขีดจำกัดนี้ ระบบจะแสดงข้อผิดพลาด RESOURCE_LIMIT

ตัวอย่าง

ตัวอย่างต่อไปนี้แสดงวิธีสร้างการยกเว้นข้อมูลที่มีขอบเขต CHANNEL ส่วนที่ใส่ความคิดเห็นจะแสดงวิธีระบุแคมเปญหากคุณตั้งค่าขอบเขต CAMPAIGN แทน

Java

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