استخدِم إعداد الاستهداف في مجموعاتك الإعلانية أو حملاتك لتحديد ما إذا كنت تريد تضييق نطاق إعلاناتك لعرضها فقط على شرائح جمهور معيّنة أو على محتوى معيّن اخترته.
إعداد إعداد الاستهداف
يمكنك إعداد تفاصيل حول كيفية استخدام أنواع المعايير المختلفة للاستهداف
من خلال ضبط حقل 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 |
لا يضيّق نطاق الوصول، وتظهر الإعلانات كالمعتاد | يسمح بإجراء تعديلات على عروض الأسعار استنادًا إلى المعايير |
سيناريوهات عملية
في ما يلي أمثلة قصيرة على وقت استخدام وضع "الملاحظة" مقابل وضع "الاستهداف":
- المراقبة
- استخدِم وضع "الملاحظة" إذا كنت تدير "حملة على شبكة البحث" وأردت معرفة مدى جودة أداء شريحة جمهور معيّنة (مثلاً، "مشجّعو الرياضة") من حيث الإحالات الناجحة مقارنةً بعامة الجمهور، بدون قصر إعلاناتك على هذه الشريحة فقط. يمكنك إضافة "مشجّعو الرياضة" كمعيار جمهور مع ضبط
bid_only = true(الملاحظة) وتطبيق تعديل عرض أسعار بنسبة +10%. يتيح لك ذلك جمع بيانات الأداء لهذه الشريحة من الجمهور وتقديم عروض أسعار أكثر تنافسية لها إذا كان أداؤها جيدًا، بدون فقدان الزيارات من المستخدمين خارج هذه الشريحة. - الاستهداف
- استخدِم وضع "الاستهداف" إذا كنت تدير "حملة على الشبكة الإعلانية" لإعادة استهداف المستخدمين الذين سبق لهم زيارة موقعك الإلكتروني ولكنّهم لم يُجروا إحالة ناجحة، وأردت أن يرى المستخدمون في قائمة المستخدمين "المتخلّون عن عربات التسوّق" هذه الإعلانات المحدّدة فقط. في هذه الحالة، يمكنك إضافة قائمة "المتخلّون عن عربات التسوّق" كمعيار
UserListمع ضبطbid_only = false(الاستهداف). يضمن ذلك إنفاق ميزانية مجموعتك الإعلانية فقط على الوصول إلى شريحة الجمهور هذه التي لديها نيّة عالية.
أفضل الممارسات
يتم ضبط bid_only تلقائيًا على false، ما يعني أنّه سيتم ضبط إعداد الاستهداف على "الاستهداف". إذا تم حذف قيد استهداف لسمة استهداف معيّنة (مثل AUDIENCE) أو لم يكن موجودًا في مصفوفة target_restrictions الخاصة بـ TargetingSetting، سيتبنّى النظام الإعداد التلقائي "الاستهداف" (bid_only يكون false ضمنيًا) لهذه السمة.
يمكن أن يختلف سلوك واجهة برمجة التطبيقات المنخفضة المستوى هذا عن واجهة مستخدم "إعلانات Google"، التي قد تطبّق تلقائيًا "الملاحظة" (bid_only يكون true) تلقائيًا لبعض سمات الاستهداف (مثل AUDIENCE للحملات على شبكة البحث) عند إنشاء الحملات أو المجموعات الإعلانية. على سبيل المثال، قد تحذف "حملات Shopping" التي يتم إنشاؤها من خلال واجهة المستخدم إعدادات سمة AUDIENCE تلقائيًا من منظور واجهة برمجة التطبيقات، ما يعني أنّها تكتسب ضمنيًا السلوك التلقائي لواجهة برمجة التطبيقات "الاستهداف" (bid_only يكون false).
إذا كنت تضيف شرائح جمهور إلى "حملة على شبكة البحث" أو "حملة تسوّق"، ننصحك بضبط إعداد الاستهداف bid_only بشكلٍ صريح على true لضبطه على "الملاحظة".
إذا كنت تُعدّ حملة مكرّرة لشرائح الجمهور للإعلانات على شبكة البحث، ننصحك بإبقاء إعداد الاستهداف 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 من المجموعة الإعلانية التي تحمل رقم التعريف المقدَّم.
جافا
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.
جافا
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
أخيرًا، إذا صادف الرمز قيد استهداف يتطلّب التعديل، سيعدِّل المجموعة الإعلانية باستخدام إعدادات الاستهداف الجديدة.
جافا
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 للحملات متطابقة تقريبًا.
الخطوات التالية
- استكشِف أنواع المعايير المتوافقة في دليل المعايير.