ใช้การตั้งค่าการกำหนดเป้าหมายในกลุ่มโฆษณาหรือ แคมเปญเพื่อระบุว่าจะจำกัดโฆษณาให้แสดงเฉพาะกลุ่มเป้าหมายที่เฉพาะเจาะจง หรือแสดงในเนื้อหาที่เฉพาะเจาะจงที่คุณเลือกหรือไม่
ตั้งค่าการกำหนดเป้าหมาย
คุณสามารถตั้งค่ารายละเอียดเกี่ยวกับวิธีใช้เกณฑ์ประเภทต่างๆ สำหรับการกำหนดเป้าหมาย
โดยการตั้งค่าฟิลด์ TargetingSetting ด้วยอาร์เรย์ของ
target_restrictions (หรือโดยการใช้การอัปเดตแบบเพิ่มทีละรายการ
โดยใช้ target_restriction_operations) TargetRestriction แต่ละรายการช่วยให้คุณควบคุมได้ว่า
TargetingDimension (AUDIENCE, TOPIC, GENDER,
AGE_RANGE, PLACEMENT, PARENTAL_STATUS, หรือ INCOME_RANGE) จะใช้ตัวเลือก
bid_only หรือไม่
เมื่อตั้งค่า bid_only เป็น true การตั้งค่าการกำหนดเป้าหมายจะตั้งค่าเป็น "การสังเกตการณ์" และระบบจะไม่ใช้เกณฑ์เพื่อจำกัดการเข้าชม แต่จะช่วยให้คุณเสนอราคาแตกต่างกันสำหรับผู้ใช้ที่แตกต่างกันในรายการได้ การตั้งค่า bid_only เป็น false จะตั้งค่าการกำหนดเป้าหมายเป็น "การกำหนดเป้าหมาย" และเปิดใช้เกณฑ์เพื่อจำกัดการเข้าชมของกลุ่มโฆษณาไว้เฉพาะผู้ใช้ในรายการเป้าหมาย
ตารางต่อไปนี้สรุปความแตกต่างที่สำคัญ
| การตั้งค่า | bid_only |
ผลต่อการเข้าถึง | ผลต่อการเสนอราคา |
|---|---|---|---|
| การกำหนดเป้าหมาย | false |
จำกัดการเข้าถึงให้แคบลงเหลือ เฉพาะ เกณฑ์ที่เลือก | ตั้งค่าการเสนอราคาที่เฉพาะเจาะจงตามเกณฑ์ได้ |
| การสังเกตการณ์ | true |
ไม่ จำกัดการเข้าถึงให้แคบลง โฆษณาจะแสดงตามปกติ | อนุญาตให้ ปรับ ราคาเสนอตามเกณฑ์ |
สถานการณ์ที่นำไปใช้ได้จริง
ต่อไปนี้คือตัวอย่างสั้นๆ ของ เวลา ที่ควรใช้โหมดการสังเกตการณ์เทียบกับโหมดการกำหนดเป้าหมาย
- การสังเกตการณ์
- ใช้โหมดการสังเกตการณ์หากคุณใช้แคมเปญ Search และต้องการทราบว่ากลุ่มเป้าหมายที่เฉพาะเจาะจง (เช่น "แฟนกีฬา") มี Conversion ดีเพียงใดเมื่อเทียบกับบุคคลทั่วไป โดยไม่จำกัดโฆษณาให้แสดงเฉพาะกลุ่มเป้าหมายนั้น คุณสามารถเพิ่ม "แฟนกีฬา" เป็นเกณฑ์กลุ่มเป้าหมายโดยตั้งค่า
bid_only = true(การสังเกตการณ์) และใช้การปรับราคาเสนอ +10% วิธีนี้ช่วยให้คุณรวบรวมข้อมูลประสิทธิภาพของกลุ่มเป้าหมายนั้นและเสนอราคาแข่งขันมากขึ้นสำหรับกลุ่มเป้าหมายนั้นหากมีประสิทธิภาพดี โดยไม่สูญเสียการเข้าชมจากผู้ใช้นอกกลุ่มเป้าหมาย - การกำหนดเป้าหมาย
- ใช้โหมดการกำหนดเป้าหมายหากคุณใช้แคมเปญ Display เพื่อรีมาร์เก็ตติ้งไปยังผู้ใช้ที่เคยเข้าชมเว็บไซต์ของคุณแต่ไม่ได้ทำ Conversion และคุณต้องการให้เฉพาะผู้ใช้ในรายชื่อผู้ใช้ "ผู้ละทิ้งรถเข็น" เห็นโฆษณาที่เฉพาะเจาะจงเหล่านี้ ในกรณีนี้ ให้เพิ่มรายชื่อ "ผู้ละทิ้งรถเข็น" เป็นเกณฑ์
UserListโดยตั้งค่าbid_only = false(การกำหนดเป้าหมาย) วิธีนี้จะช่วยให้มั่นใจได้ว่าระบบจะใช้งบประมาณของกลุ่มโฆษณาเพื่อเข้าถึงเฉพาะกลุ่มเป้าหมายที่มีความตั้งใจซื้อสูงนี้
แนวทางปฏิบัติแนะนำ
โดยค่าเริ่มต้น ระบบจะตั้งค่า bid_only เป็น false ซึ่งหมายความว่าการตั้งค่าการกำหนดเป้าหมายจะตั้งค่าเป็น "การกำหนดเป้าหมาย" หากละเว้นหรือไม่มีการจำกัดเป้าหมายสำหรับมิติข้อมูลการกำหนดเป้าหมายที่เฉพาะเจาะจง (เช่น AUDIENCE) ในอาร์เรย์ target_restrictions ของ TargetingSetting ระบบจะใช้ลักษณะการทำงานเริ่มต้นของการ "กำหนดเป้าหมาย" (bid_only จะเป็น false โดยนัย) สำหรับมิติข้อมูลนั้น
ลักษณะการทำงานของ API ระดับต่ำนี้อาจแตกต่างจาก UI ของ Google Ads ซึ่งอาจใช้ "การสังเกตการณ์" (bid_only เป็น true) โดยอัตโนมัติโดยค่าเริ่มต้นสำหรับมิติข้อมูลการกำหนดเป้าหมายบางรายการ (เช่น AUDIENCE สำหรับแคมเปญ Search) เมื่อมีการสร้างแคมเปญหรือกลุ่มโฆษณา ตัวอย่างเช่น แคมเปญ Shopping ที่สร้างผ่าน UI อาจละเว้นการตั้งค่ามิติข้อมูล AUDIENCE โดยค่าเริ่มต้นจากมุมมองของ API ซึ่งหมายความว่าแคมเปญเหล่านี้จะรับช่วงลักษณะการทำงานเริ่มต้นของ API ในการ "กำหนดเป้าหมาย" (bid_only เป็น false) โดยนัย
หากคุณเพิ่มกลุ่มเป้าหมายลงในแคมเปญ Search หรือ Shopping ให้พิจารณาการกำหนดค่าการตั้งค่าการกำหนดเป้าหมายของ bid_only เป็น true อย่างชัดเจนเพื่อตั้งค่าเป็น "การสังเกตการณ์"
หากคุณกำลังตั้งค่าแคมเปญที่ซ้ำกันสำหรับกลุ่มเป้าหมายสำหรับโฆษณา Search ให้ตั้งค่าการกำหนดเป้าหมายของ bid_only เป็น false
ข้อจำกัด
คุณจะเพิ่มหรืออัปเดต targeting_setting ใน
AdGroup ไม่ได้หากตั้งค่า targeting_setting ใน
แคมเปญระดับบน หากตั้งค่า targeting_setting ใน Campaign ระดับบน คุณต้องนำ targeting_setting ใน Campaign ระดับบนออกก่อน เช่นเดียวกัน คุณต้องนำ targeting_setting ใน AdGroup ออกก่อนเพื่อตั้งค่าใน Campaign
หากต้องการนำ targeting_setting ออกจาก Campaign หรือ AdGroup ให้ส่งการดำเนินการ update
ที่ล้าง targeting_setting.target_restrictions (ตั้งค่าเป็นรายการว่างเปล่า) และใส่ targeting_setting.target_restrictions ใน
update_mask
ดึงข้อมูลการตั้งค่าการกำหนดเป้าหมาย
หากต้องการยืนยันว่าคุณได้ตั้งค่าการกำหนดเป้าหมายตามที่ต้องการ ให้ตรวจสอบ
targeting_setting ในกลุ่มโฆษณาหรือแคมเปญโดยขอฟิลด์
ad_group.targeting_setting.target_restrictions
จากทรัพยากร ad_group หรือฟิลด์
campaign.targeting_setting.target_restrictions
จากทรัพยากร campaign ในคำค้นหา
ตัวอย่าง
ตัวอย่างนี้จะอัปเดต targeting_setting ในกลุ่มโฆษณาเพื่อให้ bid_only
เป็น true สำหรับอินสแตนซ์ TargetRestriction ที่มี targeting_dimension เป็น
AUDIENCE ซึ่งช่วยให้คุณสังเกตประสิทธิภาพและตั้งค่า
การปรับราคาเสนอสำหรับผู้ใช้ในกลุ่มเป้าหมายได้โดยไม่จำกัดการเข้าถึง
ขั้นแรก ให้ดึงข้อมูล ad_group.targeting_setting.target_restrictions ทั้งหมดจากกลุ่มโฆษณาที่มีรหัสที่ระบุ
Java
String searchQuery = "SELECT ad_group.id, ad_group.name, ad_group.targeting_setting.target_restrictions " + "FROM ad_group " + "WHERE ad_group.id = " + adGroupId;
C#
string query = $@" SELECT ad_group.id, ad_group.name, ad_group.targeting_setting.target_restrictions FROM ad_group WHERE ad_group.id = {adGroupId}";
PHP
$query = "SELECT ad_group.id, ad_group.name, " . "ad_group.targeting_setting.target_restrictions " . "FROM ad_group " . "WHERE ad_group.id = $adGroupId";
Python
query: str = f""" SELECT ad_group.id, ad_group.name, ad_group.targeting_setting.target_restrictions FROM ad_group WHERE ad_group.id = {ad_group_id}"""
Ruby
query = <<~QUERY SELECT ad_group.id, ad_group.name, ad_group.targeting_setting.target_restrictions FROM ad_group WHERE ad_group.id = #{ad_group_id} QUERY
Perl
my $query = "SELECT ad_group.id, ad_group.name, " . "ad_group.targeting_setting.target_restrictions FROM ad_group " . "WHERE ad_group.id = $ad_group_id";
curl
จากนั้น ให้วนซ้ำการจำกัดเป้าหมายและสร้างออบเจ็กต์ TargetingSetting ใหม่ หากโค้ดพบ TargetRestriction ที่มี targeting_dimension เป็น AUDIENCE และค่า bid_only เป็น false โค้ดจะอัปเดตฟิลด์ bid_only ของออบเจ็กต์ TargetRestriction เป็น true (หรือ "การสังเกตการณ์") และเพิ่มลงในออบเจ็กต์ TargetingSetting ไม่เช่นนั้น ให้เพิ่มออบเจ็กต์ TargetRestriction ที่แสดงจากเซิร์ฟเวอร์ลงใน TargetingSetting
Java
for (TargetRestriction targetRestriction : targetRestrictions) { TargetingDimension targetingDimension = targetRestriction.getTargetingDimension(); boolean bidOnly = targetRestriction.getBidOnly(); System.out.printf( "- Targeting restriction with targeting dimension '%s' and bid only set to '%b'.%n", targetingDimension, bidOnly); // Adds the target restriction to the TargetingSetting object as is if the targeting // dimension has a value other than AUDIENCE because those should not change. if (!targetingDimension.equals(TargetingDimension.AUDIENCE)) { targetingSettingBuilder.addTargetRestrictions(targetRestriction); } else if (!bidOnly) { shouldUpdateTargetingSetting = true; // Adds an AUDIENCE target restriction with bid_only set to true to the targeting // setting object. This has the effect of setting the AUDIENCE target restriction to // "Observation". For more details about the targeting setting, visit // https://support.google.com/google-ads/answer/7365594. targetingSettingBuilder.addTargetRestrictions( TargetRestriction.newBuilder() .setTargetingDimensionValue(TargetingDimension.AUDIENCE_VALUE) .setBidOnly(true)); } }
C#
foreach (TargetRestriction targetRestriction in targetRestrictions) { TargetingDimension targetingDimension = targetRestriction.TargetingDimension; bool bidOnly = targetRestriction.BidOnly; Console.WriteLine("\tTargeting restriction with targeting dimension " + $"'{targetingDimension}' and bid only set to '{bidOnly}'."); // Add the target restriction to the TargetingSetting object as is if the // targeting dimension has a value other than AUDIENCE because those should // not change. if (targetingDimension != TargetingDimension.Audience) { targetingSetting.TargetRestrictions.Add(targetRestriction); } else if (!bidOnly) { shouldUpdateTargetingSetting = true; // Add an AUDIENCE target restriction with bid_only set to true to the // targeting setting object. This has the effect of setting the AUDIENCE // target restriction to "Observation". For more details about the // targeting setting, visit // https://support.google.com/google-ads/answer/7365594. targetingSetting.TargetRestrictions.Add(new TargetRestriction { TargetingDimension = TargetingDimension.Audience, BidOnly = true }); } }
PHP
foreach ( $adGroup->getTargetingSetting()->getTargetRestrictions() as $targetRestriction ) { // Prints the results. $targetingDimension = $targetRestriction->getTargetingDimension(); $bidOnly = $targetRestriction->getBidOnly(); printf( "- Targeting restriction with targeting dimension '%s' and bid only set to " . "'%s'.%s", TargetingDimension::name($targetingDimension), $bidOnly ? 'true' : 'false', PHP_EOL ); // Adds the target restriction to the TargetingSetting object as is if the targeting // dimension has a value other than AUDIENCE because those should not change. if ($targetingDimension !== TargetingDimension::AUDIENCE) { $targetRestrictions[] = $targetRestriction; } elseif (!$bidOnly) { $shouldUpdateTargetingSetting = true; // Adds an AUDIENCE target restriction with bid_only set to true to the // targeting setting object. This has the effect of setting the AUDIENCE // target restriction to "Observation". // For more details about the targeting setting, visit // https://support.google.com/google-ads/answer/7365594. $targetRestrictions[] = new TargetRestriction( [ 'targeting_dimension' => TargetingDimension::AUDIENCE, 'bid_only' => true ] ); } }
Python
target_restriction: TargetRestriction for target_restriction in target_restrictions: targeting_dimension: TargetingDimensionEnum.TargetingDimension = ( target_restriction.targeting_dimension ) bid_only: bool = target_restriction.bid_only print( "\tTargeting restriction with targeting dimension " f"'{targeting_dimension.name}' " f"and bid only set to '{bid_only}'." ) # Add the target restriction to the TargetingSetting object as # is if the targeting dimension has a value other than audience # because those should not change. if targeting_dimension != targeting_dimension_enum.AUDIENCE: targeting_setting.target_restrictions.append(target_restriction) elif not bid_only: should_update_targeting_setting: bool = True # Add an audience target restriction with bid_only set to # true to the targeting setting object. This has the effect # of setting the audience target restriction to # "Observation". For more details about the targeting # setting, visit # https://support.google.com/google-ads/answer/7365594. new_target_restriction: TargetRestriction = ( targeting_setting.target_restrictions.add() ) new_target_restriction.targeting_dimension = ( targeting_dimension_enum.AUDIENCE ) new_target_restriction.bid_only = True
Ruby
ad_group.targeting_setting.target_restrictions.each do |r| # Prints the results. targeting_dimension = r.targeting_dimension bid_only = r.bid_only puts "- Targeting restriction with targeting dimension " \ "#{targeting_dimension} and bid only set to #{bid_only}." # Adds the target restriction to the TargetingSetting object as is if the # targeting dimension has a value other than AUDIENCE because those should # not change. if targeting_dimension != :AUDIENCE target_restrictions << r elsif !bid_only should_update_targeting_setting = true # Adds an AUDIENCE target restriction with bid_only set to true to the # targeting setting object. This has the effect of setting the AUDIENCE # target restriction to "Observation". # For more details about the targeting setting, visit # https://support.google.com/google-ads/answer/7365594. target_restrictions << client.resource.target_restriction do |tr| tr.targeting_dimension = :AUDIENCE tr.bid_only = true end end end
Perl
foreach my $target_restriction (@target_restrictions) { my $targeting_dimension = $target_restriction->{targetingDimension}; printf "\tTargeting restriction with targeting dimension '%s' and bid " . "only set to '%s'.\n", $targeting_dimension, $target_restriction->{bidOnly} ? "TRUE" : "FALSE"; # Add the target restriction to the TargetingSetting object as is if the # targeting dimension has a value other than AUDIENCE because those # should not change. if ($targeting_dimension ne AUDIENCE) { $target_restriction->{bidOnly} = $target_restriction->{bidOnly} ? "true" : "false"; push @{$targeting_setting->{targetRestrictions}}, $target_restriction; } elsif (!$target_restriction->{bidOnly}) { $should_update_target_setting = 1; # Add an AUDIENCE target restriction with bid_only set to true to the # targeting setting object. This has the effect of setting the # AUDIENCE target restriction to "Observation". For more details about # the targeting setting, visit # https://support.google.com/google-ads/answer/7365594. my $new_restriction = Google::Ads::GoogleAds::V25::Common::TargetRestriction->new({ targetingDimension => AUDIENCE, bidOnly => "true" }); push @{$targeting_setting->{targetRestrictions}}, $new_restriction; } }
curl
สุดท้ายนี้ หากโค้ดพบการจำกัดเป้าหมายที่ต้องอัปเดต โค้ดจะอัปเดตกลุ่มโฆษณาด้วยการตั้งค่าการกำหนดเป้าหมายใหม่
Java
private void updateTargetingSetting( GoogleAdsClient googleAdsClient, long customerId, long adGroupId, TargetingSetting targetingSetting) { // Creates the ad group service client. try (AdGroupServiceClient adGroupServiceClient = googleAdsClient.getLatestVersion().createAdGroupServiceClient()) { // Creates an ad group object with the proper resource name and updated targeting setting. AdGroup adGroup = AdGroup.newBuilder() .setResourceName(ResourceNames.adGroup(customerId, adGroupId)) .setTargetingSetting(targetingSetting) .build(); // Constructs an operation that will update the ad group, using the FieldMasks utility to // derive the update mask. This mask tells the Google Ads API which attributes of the // ad group you want to change. AdGroupOperation operation = AdGroupOperation.newBuilder() .setUpdate(adGroup) .setUpdateMask(FieldMasks.allSetFieldsOf(adGroup)) .build(); // Sends the operation in a mutate request. MutateAdGroupsResponse response = adGroupServiceClient.mutateAdGroups( Long.toString(customerId), ImmutableList.of(operation)); // Prints the resource name of the updated object. System.out.printf( "Updated targeting setting of ad group with resource name '%s'; set the AUDIENCE " + "target restriction to 'Observation'.%n", response.getResults(0).getResourceName()); } }
C#
private void UpdateTargetingSetting(GoogleAdsClient client, long customerId, long adGroupId, TargetingSetting targetingSetting) { // Get the AdGroupService client. AdGroupServiceClient adGroupServiceClient = client.GetService(Services.V25.AdGroupService); // Create an ad group object with the updated targeting setting. AdGroup adGroup = new AdGroup { ResourceName = ResourceNames.AdGroup(customerId, adGroupId), TargetingSetting = targetingSetting }; // Construct an operation that will update the ad group, using the FieldMasks utility // to derive the update mask. This mask tells the Google Ads API which attributes of the // ad group you want to change. AdGroupOperation operation = new AdGroupOperation { Update = adGroup, UpdateMask = FieldMasks.AllSetFieldsOf(adGroup) }; // Send the operation in a mutate request. MutateAdGroupsResponse response = adGroupServiceClient.MutateAdGroups(customerId.ToString(), new[] { operation }); // Print the resource name of the updated object. Console.WriteLine("Updated targeting setting of ad group with resource name " + $"'{response.Results.First().ResourceName}'; set the AUDIENCE target restriction " + "to 'Observation'."); }
PHP
private static function updateTargetingSetting( GoogleAdsClient $googleAdsClient, int $customerId, int $adGroupId, TargetingSetting $targetingSetting ) { // Creates an ad group object with the proper resource name and updated targeting setting. $adGroup = new AdGroup( [ 'resource_name' => ResourceNames::forAdGroup($customerId, $adGroupId), 'targeting_setting' => $targetingSetting ] ); // Constructs an operation that will update the ad group with the specified resource name, // using the FieldMasks utility to derive the update mask. This mask tells the Google Ads // API which attributes of the ad group you want to change. $adGroupOperation = new AdGroupOperation(); $adGroupOperation->setUpdate($adGroup); $adGroupOperation->setUpdateMask(FieldMasks::allSetFieldsOf($adGroup)); // Issues a mutate request to update the ad group. $adGroupServiceClient = $googleAdsClient->getAdGroupServiceClient(); $response = $adGroupServiceClient->mutateAdGroups( MutateAdGroupsRequest::build($customerId, [$adGroupOperation]) ); // Prints the resource name of the updated ad group. printf( "Updated targeting setting of ad group with resource name '%s'; set the AUDIENCE " . "target restriction to 'Observation'.%s", $response->getResults()[0]->getResourceName(), PHP_EOL ); }
Python
def update_targeting_setting( client: GoogleAdsClient, customer_id: str, ad_group_id: str, targeting_setting: TargetingSetting, ) -> None: """Updates the given TargetingSetting of an ad group. Args: client: The Google Ads client. customer_id: The Google Ads customer ID. ad_group_id: The ad group ID for which to update the audience targeting restriction. targeting_setting: The updated targeting setting. """ # Get the AdGroupService client. ad_group_service: AdGroupServiceClient = client.get_service( "AdGroupService" ) # Construct an operation that will update the ad group. ad_group_operation: AdGroupOperation = client.get_type("AdGroupOperation") # Populate the ad group object with the updated targeting setting. ad_group: AdGroup = ad_group_operation.update ad_group.resource_name = ad_group_service.ad_group_path( customer_id, ad_group_id ) ad_group.targeting_setting.target_restrictions.extend( targeting_setting.target_restrictions ) # Use the field_mask utility to derive the update mask. This mask tells the # Google Ads API which attributes of the ad group you want to change. client.copy_from( ad_group_operation.update_mask, protobuf_helpers.field_mask(None, ad_group._pb), ) # Send the operation in a mutate request and print the resource name of the # updated object. mutate_ad_groups_response: MutateAdGroupsResponse = ( ad_group_service.mutate_ad_groups( customer_id=customer_id, operations=[ad_group_operation] ) ) print( "Updated targeting setting of ad group with resource name " f"'{mutate_ad_groups_response.results[0].resource_name}'; set the " "audience target restriction to 'Observation'." )
Ruby
def update_targeting_setting( client, customer_id, ad_group_id, targeting_setting) # Constructs an operation that will update the ad group with the specified # resource name. ad_group_resource_name = client.path.ad_group(customer_id, ad_group_id) operation = client.operation.update_resource.ad_group(ad_group_resource_name) do |ag| ag.targeting_setting = targeting_setting end # Issues a mutate request to update the ad group. response = client.service.ad_group.mutate_ad_groups( customer_id: customer_id, operations: [operation], ) # Prints the resource name of the updated ad group. puts "Updated targeting setting of ad group with resource name " \ "#{response.results.first.resource_name}; set the AUDIENCE target " \ "restriction to 'Observation'." end
Perl
sub update_targeting_setting { my ($api_client, $customer_id, $ad_group_id, $targeting_setting) = @_; # Construct an ad group object with the updated targeting setting. my $ad_group = Google::Ads::GoogleAds::V25::Resources::AdGroup->new({ resourceName => Google::Ads::GoogleAds::V25::Utils::ResourceNames::ad_group( $customer_id, $ad_group_id ), targetingSetting => $targeting_setting }); # Create an operation that will update the ad group, using the FieldMasks # utility to derive the update mask. This mask tells the Google Ads API which # attributes of the ad group you want to change. my $ad_group_operation = Google::Ads::GoogleAds::V25::Services::AdGroupService::AdGroupOperation-> new({ update => $ad_group, updateMask => all_set_fields_of($ad_group)}); # Send the operation in a mutate request and print the resource name of the # updated resource. my $ad_groups_response = $api_client->AdGroupService()->mutate({ customerId => $customer_id, operations => [$ad_group_operation]}); printf "Updated targeting setting of ad group with resourceName " . "'%s'; set the AUDIENCE target restriction to 'Observation'.\n", $ad_groups_response->{results}[0]{resourceName}; }
curl
กระบวนการตั้งค่าฟิลด์ bid_only สำหรับแคมเปญจะเกือบเหมือนกัน
ขั้นตอนถัดไป
- ดูประเภทเกณฑ์ที่รองรับในคู่มือเกณฑ์