बिड मॉडिफ़ायर मैनेज करना

कैंपेन और विज्ञापन ग्रुप-लेवल बिड घटाना या बढ़ाना आपको अपनी बिड पर ज़्यादा कंट्रोल मिलेगा, Google Ads कैंपेन से, जिनमें बिड को बढ़ाने या घटाने का विकल्प मिलता है है.

Google Ads API के अंदर, कैंपेन-लेवल अडजस्टमेंट को इसका इस्तेमाल करके ऐक्सेस किया जा सकता है CampaignBidModifierService और विज्ञापन ग्रुप-लेवल पर किए गए अडजस्टमेंट को ऐक्सेस करने के लिए, इनका इस्तेमाल किया जा सकता है AdGroupBidModifierService.

बिड घटाने या बढ़ाने की सुविधा को जोड़ना, अपडेट करना, और हटाना

इसके create, update या remove फ़ील्ड का इस्तेमाल करें CampaignBidModifierOperation या AdGroupBidModifierOperation कार्रवाइयों के लिए इस्तेमाल किया जा सकता है.

के लिए, एपीआई दस्तावेज़ सबमिट करना.

इस उदाहरण में विज्ञापन समूह-स्तरीय नई मोबाइल बोली जोड़ने का तरीका बताया गया है समायोजन:

Java

private void runExample(
    GoogleAdsClient googleAdsClient, long customerId, long adGroupId, double bidModifier) {

  // Creates an ad group bid modifier for mobile devices with the specified ad group ID and
  // bid modifier value.
  AdGroupBidModifier adGroupBidModifier =
      AdGroupBidModifier.newBuilder()
          .setAdGroup(ResourceNames.adGroup(customerId, adGroupId))
          .setBidModifier(bidModifier)
          .setDevice(DeviceInfo.newBuilder().setType(Device.MOBILE))
          .build();

  // Creates an ad group bid modifier operation for creating an ad group bid modifier.
  AdGroupBidModifierOperation adGroupBidModifierOperation =
      AdGroupBidModifierOperation.newBuilder().setCreate(adGroupBidModifier).build();

  // Issues a mutate request to add the ad group bid modifier.
  try (AdGroupBidModifierServiceClient adGroupBidModifierServiceClient =
      googleAdsClient.getLatestVersion().createAdGroupBidModifierServiceClient()) {
    MutateAdGroupBidModifiersResponse response =
        adGroupBidModifierServiceClient.mutateAdGroupBidModifiers(
            Long.toString(customerId), ImmutableList.of(adGroupBidModifierOperation));

    System.out.printf("Added %d ad group bid modifiers:%n", response.getResultsCount());
    for (MutateAdGroupBidModifierResult mutateAdGroupBidModifierResult :
        response.getResultsList()) {
      System.out.printf("\t%s%n", mutateAdGroupBidModifierResult.getResourceName());
    }
  }
}
      

C#

public void Run(GoogleAdsClient client, long customerId, long adGroupId,
    double bidModifierValue)
{
    // Get the AdGroupBidModifierService.
    AdGroupBidModifierServiceClient adGroupBidModifierService =
        client.GetService(Services.V17.AdGroupBidModifierService);

    // Creates an ad group bid modifier for mobile devices with the specified ad group
    // ID and bid modifier value.
    AdGroupBidModifier adGroupBidModifier = new AdGroupBidModifier()
    {
        AdGroup = ResourceNames.AdGroup(customerId, adGroupId),
        BidModifier = bidModifierValue,
        Device = new DeviceInfo()
        {
            Type = Device.Mobile
        }
    };

    // Creates an ad group bid modifier operation for creating an ad group bid modifier.
    AdGroupBidModifierOperation adGroupBidModifierOperation =
        new AdGroupBidModifierOperation()
        {
            Create = adGroupBidModifier
        };

    // Send the operation in a mutate request.
    try
    {
        MutateAdGroupBidModifiersResponse response =
            adGroupBidModifierService.MutateAdGroupBidModifiers(customerId.ToString(),
                new AdGroupBidModifierOperation[] { adGroupBidModifierOperation });
        Console.WriteLine("Added {0} ad group bid modifiers:", response.Results.Count);
        foreach (MutateAdGroupBidModifierResult result in response.Results)
        {
            Console.WriteLine($"\t{result.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

public static function runExample(
    GoogleAdsClient $googleAdsClient,
    int $customerId,
    int $adGroupId,
    float $bidModifierValue
) {
    // Creates an ad group bid modifier for mobile devices with the specified ad group ID and
    // bid modifier value.
    $adGroupBidModifier = new AdGroupBidModifier([
        'ad_group' => ResourceNames::forAdGroup($customerId, $adGroupId),
        'bid_modifier' => $bidModifierValue,
        'device' => new DeviceInfo(['type' => Device::MOBILE])
    ]);

    // Creates an ad group bid modifier operation for creating an ad group bid modifier.
    $adGroupBidModifierOperation = new AdGroupBidModifierOperation();
    $adGroupBidModifierOperation->setCreate($adGroupBidModifier);

    // Issues a mutate request to add the ad group bid modifier.
    $adGroupBidModifierServiceClient = $googleAdsClient->getAdGroupBidModifierServiceClient();
    $response = $adGroupBidModifierServiceClient->mutateAdGroupBidModifiers(
        MutateAdGroupBidModifiersRequest::build($customerId, [$adGroupBidModifierOperation])
    );

    printf("Added %d ad group bid modifier:%s", $response->getResults()->count(), PHP_EOL);

    foreach ($response->getResults() as $addedAdGroupBidModifier) {
        /** @var AdGroupBidModifier $addedAdGroupBidModifier */
        print $addedAdGroupBidModifier->getResourceName() . PHP_EOL;
    }
}
      

Python

def main(client, customer_id, ad_group_id, bid_modifier_value):
    ad_group_service = client.get_service("AdGroupService")
    ad_group_bm_service = client.get_service("AdGroupBidModifierService")

    # Create ad group bid modifier for mobile devices with the specified ad
    # group ID and bid modifier value.
    ad_group_bid_modifier_operation = client.get_type(
        "AdGroupBidModifierOperation"
    )
    ad_group_bid_modifier = ad_group_bid_modifier_operation.create

    # Set the ad group.
    ad_group_bid_modifier.ad_group = ad_group_service.ad_group_path(
        customer_id, ad_group_id
    )

    # Set the bid modifier.
    ad_group_bid_modifier.bid_modifier = bid_modifier_value

    # Sets the device.
    device_enum = client.enums.DeviceEnum
    ad_group_bid_modifier.device.type_ = device_enum.MOBILE

    # Add the ad group bid modifier.
    ad_group_bm_response = ad_group_bm_service.mutate_ad_group_bid_modifiers(
        customer_id=customer_id,
        operations=[ad_group_bid_modifier_operation],
    )
      

Ruby

def add_ad_group_bid_modifier(customer_id, ad_group_id, bid_modifier_value)
  # GoogleAdsClient will read a config file from
  # ENV['HOME']/google_ads_config.rb when called without parameters
  client = Google::Ads::GoogleAds::GoogleAdsClient.new

  # Creates an ad group bid modifier for mobile devices with the specified
  # ad group ID and bid modifier value.
  ad_group_bid_modifier = client.resource.ad_group_bid_modifier do |mod|
    # Sets the ad group.
    mod.ad_group = client.path.ad_group(customer_id, ad_group_id)

    # Sets the Bid Modifier.
    mod.bid_modifier = bid_modifier_value

    # Sets the Device.
    mod.device = client.resource.device_info do |device|
      device.type = :MOBILE
    end
  end

  # Create the operation.
  operation = client.operation.create_resource.ad_group_bid_modifier(ad_group_bid_modifier)

  # Add the ad group ad.
  response = client.service.ad_group_bid_modifier.mutate_ad_group_bid_modifiers(
    customer_id: customer_id,
    operations: [operation]
  )

  puts "Added #{response.results.size} ad group bid modifiers:"
  response.results.each do |added_ad_group_bid_modifier|
    puts "\t#{added_ad_group_bid_modifier.resource_name}"
  end
end
      

Perl

sub add_ad_group_bid_modifier {
  my ($api_client, $customer_id, $ad_group_id, $bid_modifier_value) = @_;

  # Create an ad group bid modifier for mobile devices with the specified ad group ID and
  # bid modifier value.
  my $ad_group_bid_modifier =
    Google::Ads::GoogleAds::V17::Resources::AdGroupBidModifier->new({
      adGroup => Google::Ads::GoogleAds::V17::Utils::ResourceNames::ad_group(
        $customer_id, $ad_group_id
      ),
      bidModifier => $bid_modifier_value,
      device      => Google::Ads::GoogleAds::V17::Common::DeviceInfo->new({
          type => MOBILE
        })});

  # Create an ad group bid modifier operation.
  my $ad_group_bid_modifier_operation =
    Google::Ads::GoogleAds::V17::Services::AdGroupBidModifierService::AdGroupBidModifierOperation
    ->new({
      create => $ad_group_bid_modifier
    });

  # Add the ad group bid modifier.
  my $ad_group_bid_modifiers_response =
    $api_client->AdGroupBidModifierService()->mutate({
      customerId => $customer_id,
      operations => [$ad_group_bid_modifier_operation]});

  printf "Created ad group bid modifier '%s'.\n",
    $ad_group_bid_modifiers_response->{results}[0]{resourceName};

  return 1;
}
      

बोली समायोजन फिर से पाएं

आप campaign_bid_modifier मान. विज्ञापन में समूह स्तर, इसके लिए खोज करें ad_group_bid_modifier. यहां एक GAQL क्वेरी दी गई है, जो किसी विज्ञापन ग्रुप से संबंधित:

SELECT
  campaign.id,
  ad_group.id,
  ad_group_bid_modifier.bid_modifier,
  ad_group_bid_modifier.criterion_id
FROM ad_group_bid_modifier
WHERE ad_group.id = ad_group_id