Utilisez le paramètre de ciblage dans vos groupes d'annonces ou vos campagnes pour indiquer si vous souhaitez diffuser vos annonces auprès de segments d'audience spécifiques ou dans un contenu particulier que vous avez sélectionnés.
Configurer le paramètre de ciblage
Vous pouvez configurer la manière dont vos différents types de critères sont utilisés pour le ciblage en définissant le champ TargetingSetting avec un tableau de target_restrictions (ou en appliquant des mises à jour incrémentielles à l'aide de target_restriction_operations). Chaque TargetRestriction vous permet de contrôler si un TargetingDimension (AUDIENCE, TOPIC, GENDER, AGE_RANGE, PLACEMENT, PARENTAL_STATUS ou INCOME_RANGE) utilise l'option bid_only ou non.
Lorsque vous définissez bid_only sur true, le paramètre de ciblage est défini sur "Observation". Les critères ne sont pas utilisés pour limiter le trafic, mais vous permettent de définir des enchères différentes pour les différents utilisateurs de vos listes. Si vous définissez bid_only sur false, le paramètre de ciblage est défini sur "Ciblage" et les critères sont activés pour limiter le trafic du groupe d'annonces aux seuls utilisateurs de la liste ciblée.
Les principales différences sont résumées dans le tableau suivant :
| Paramètre | bid_only |
Impact sur la couverture | Impact sur les enchères |
|---|---|---|---|
| Ciblage | false |
Restreint la couverture aux seuls critères sélectionnés | Possibilité de définir des enchères spécifiques sur des critères |
| Observation | true |
Ne limite pas la couverture ; les annonces sont diffusées normalement | Permet d'ajuster les enchères en fonction de critères |
Scénarios pratiques
Voici quelques exemples d'utilisation du mode "Observation" par rapport au mode "Ciblage" :
- Observation
- Utilisez le mode Observation si vous diffusez une campagne sur le Réseau de Recherche et que vous souhaitez savoir comment une audience spécifique (par exemple, les "fans de sport") convertit par rapport au grand public, sans limiter vos annonces à cette audience. Vous pouvez ajouter "fans de sport" comme critère d'audience avec
bid_only = true(Observation) et appliquer un ajustement des enchères de +10 %. Vous pouvez ainsi collecter des données sur les performances de cette audience et enchérir de manière plus compétitive si elle est performante, sans perdre le trafic des utilisateurs qui n'en font pas partie. - Ciblage
- Utilisez le mode "Ciblage" si vous diffusez une campagne display pour remarketer les utilisateurs qui ont déjà visité votre site Web, mais n'ont pas effectué de conversion, et que vous souhaitez que seuls les utilisateurs de votre liste d'utilisateurs "Abandon du panier" voient ces annonces spécifiques. Dans ce cas, vous ajoutez la liste "Utilisateurs ayant abandonné leur panier" en tant que critère
UserListavecbid_only = false(Ciblage). Ainsi, le budget de votre groupe d'annonces ne sera dépensé que pour toucher ce segment d'audience à forte intention.
Bonnes pratiques
Pour les dimensions de ciblage non démographiques (comme AUDIENCE), bid_only est défini sur false par défaut, ce qui signifie que le paramètre de ciblage est défini sur "Ciblage".
Si une restriction de ciblage pour l'une de ces dimensions est omise ou n'est pas présente dans le tableau target_restrictions d'un TargetingSetting, le système adopte le comportement par défaut "Ciblage" (bid_only est implicitement false) pour cette dimension.
Le comportement de cette API de bas niveau peut différer de celui de l'interface utilisateur Google Ads, qui peut appliquer automatiquement "Observation" (bid_only est true) par défaut pour certaines dimensions de ciblage (comme AUDIENCE pour les campagnes sur le Réseau de Recherche) lors de la création de campagnes ou de groupes d'annonces. Par exemple, les campagnes Shopping créées via l'UI peuvent omettre les paramètres de dimension AUDIENCE par défaut du point de vue de l'API, ce qui signifie qu'elles héritent implicitement du comportement par défaut de l'API "Ciblage" (bid_only est false).
Si vous ajoutez des segments d'audience à une campagne sur le Réseau de Recherche ou une campagne Shopping, envisagez de configurer explicitement le paramètre de ciblage de bid_only sur true pour le définir sur "Observation".
Si vous configurez une campagne en double pour les segments d'audience pour les annonces sur le Réseau de Recherche,
conservez le ciblage de bid_only défini sur false.
Restrictions
Vous ne pouvez pas ajouter ni modifier targeting_setting sur un AdGroup si targeting_setting est défini sur la campagne parente. Si targeting_setting est défini sur le Campaign parent, vous devez d'abord supprimer targeting_setting sur le Campaign parent. De même, vous devez d'abord supprimer le targeting_setting sur le AdGroup pour pouvoir le définir sur le Campaign.
Pour supprimer un targeting_setting d'un Campaign ou d'un AdGroup, envoyez une opération update où targeting_setting.target_restrictions est effacé (défini sur une liste vide) et incluez targeting_setting.target_restrictions dans le update_mask.
Récupérer le paramètre de ciblage
Pour vérifier que votre ciblage est configuré comme prévu, vérifiez le targeting_setting sur les groupes d'annonces ou les campagnes en demandant le champ ad_group.targeting_setting.target_restrictions de la ressource ad_group ou le champ campaign.targeting_setting.target_restrictions de la ressource campaign dans une requête de recherche.
Exemple
Cet exemple met à jour le targeting_setting d'un groupe d'annonces afin que bid_only soit true pour les instances TargetRestriction avec un targeting_dimension de AUDIENCE. Cela vous permet d'observer les performances et de définir des ajustements des enchères pour les utilisateurs du segment d'audience sans limiter la couverture.
Tout d'abord, récupérez tous les ad_group.targeting_setting.target_restrictions du groupe d'annonces avec l'ID fourni.
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
Ensuite, parcourez les restrictions de ciblage et reconstruisez les objets TargetingSetting. Si le code rencontre un TargetRestriction avec un targeting_dimension de AUDIENCE et une valeur bid_only de false, il met à jour le champ bid_only de l'objet TargetRestriction sur true (ou "Observation") et l'ajoute à l'objet TargetingSetting. Sinon, ajoutez l'objet TargetRestriction renvoyé par le serveur à 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::V26::Common::TargetRestriction->new({ targetingDimension => AUDIENCE, bidOnly => "true" }); push @{$targeting_setting->{targetRestrictions}}, $new_restriction; } }
curl
Enfin, si le code rencontre une restriction de ciblage qui nécessite une mise à jour, il met à jour le groupe d'annonces avec les nouveaux paramètres de ciblage.
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.V26.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::V26::Resources::AdGroup->new({ resourceName => Google::Ads::GoogleAds::V26::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::V26::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
La procédure de définition du champ bid_only pour les campagnes est presque identique.
Étape suivante
- Découvrez les types de critères acceptés dans le guide des critères.