खाते का बजट

खाते के बजट से यह कंट्रोल होता है कि कोई खाता किसी खास अवधि में कितना खर्च कर सकता है. इसके लिए, खर्च की सीमा, शुरू होने का समय, और खत्म होने का समय जैसी बजट प्रॉपर्टी तय करें. उन्हें खाते के किसी एक बिलिंग सेटअप पर जाना होगा, ताकि यह बताया जा सके कि किस पेमेंट्स खाते की बिलिंग की जाएगी. AccountBudgetProposal ऑब्जेक्ट भेजकर, AccountBudget बनाया, अपडेट किया जा सकता है, और हटाया जा सकता है.

AccountBudget ऑब्जेक्ट, प्रस्तावों को लागू करने का नतीजा दिखाते हैं. प्रस्ताव स्वीकार किए जाने के बाद, इसमें किए गए बदलावों (किसी भी अडजस्टमेंट के आधार पर) की वजह से खाते का नया बजट बन जाएगा या मौजूदा बजट अपडेट हो जाएगा. यह अनुरोध में बताए गए proposal_type के हिसाब से तय होता है.

AccountBudgetProposalType कंपनी का ब्यौरा
CREATE खाते का एक नया बजट बनाता है, जिसे इस्तेमाल करने से पहले मंज़ूरी मिलना ज़रूरी है.
UPDATE खाते के मौजूदा बजट में बदलाव करता है.
END खाते के बजट के खत्म होने का समय, मौजूदा समय पर सेट करता है.
REMOVE खाते के बजट को शुरू होने के समय से पहले हटा देता है.

नीचे दिए गए सेक्शन में हर तरह के प्रस्ताव के व्यवहार के बारे में बताया गया है.

खाता बजट प्रस्ताव बनाना

खाते का नया बजट बनाने से, ग्राहक के खर्च करने के व्यवहार को कंट्रोल किया जा सकता है. नया AccountBudgetProposal बनाने के लिए, AccountBudgetProposalService का इस्तेमाल करें. proposal_type को CREATE पर सेट करके यह तय करें कि नया बजट बनाना है. अन्य कार्रवाइयों के लिए, इस गाइड के मैनेजमेंट सेक्शन पर जाएं.

उस पेमेंट्स खाते के साथ बिलिंग सेटअप का इस्तेमाल करना न भूलें जिसमें आपके पास लिखने का ऐक्सेस है. ज़्यादा जानकारी के लिए, बिलिंग सेटअप गाइड देखें.

नीचे दिए गए उदाहरण में एक नया बजट प्रस्ताव बनाने का तरीका बताया गया है.

Java

private void runExample(GoogleAdsClient googleAdsClient, long customerId, long billingSetupId) {
  // Creates an AccountBudgetProposal. This will be reviewed offline by Google Ads, and if
  // approved will become an AccountBudget.
  AccountBudgetProposal proposal =
      AccountBudgetProposal.newBuilder()
          .setBillingSetup(ResourceNames.billingSetup(customerId, billingSetupId))
          .setProposalType(AccountBudgetProposalType.CREATE)
          .setProposedName("Account Budget (example)")

          // Specifies the account budget starts immediately.
          .setProposedStartTimeType(TimeType.NOW)
          // Alternatively you can specify a specific start time. Refer to the
          // AccountBudgetProposal
          // resource documentation for allowed formats.
          //
          // .setProposedStartDateTime("2020-01-02 03:04:05")

          // Specifies that the budget runs forever.
          .setProposedEndTimeType(TimeType.FOREVER)
          // Alternatively you can specify a specific end time. Allowed formats are as above.
          // .setProposedEndDateTime("2021-02-03 04:05:06")

          // Optional: sets notes for the budget. These are free text and do not effect budget
          // delivery.
          // .setProposedNotes("Received prepayment of $0.01")

          // Sets the spending limit to 0.01, measured in the Google Ads account currency.
          .setProposedSpendingLimitMicros(10_000)

          // Optional: sets PO number for record keeping. This value is at the user's
          // discretion, and has no effect on Google Billing & Payments.
          // .setProposedPurchaseOrderNumber("PO number 12345")
          .build();

  // Creates an operation which will add the new AccountBudgetProposal.
  AccountBudgetProposalOperation operation =
      AccountBudgetProposalOperation.newBuilder().setCreate(proposal).build();

  try (AccountBudgetProposalServiceClient accountBudgetProposalServiceClient =
      googleAdsClient.getLatestVersion().createAccountBudgetProposalServiceClient()) {
    // Sends the request to the Account Budget Proposal Service.
    MutateAccountBudgetProposalResponse response =
        accountBudgetProposalServiceClient.mutateAccountBudgetProposal(
            String.valueOf(customerId), operation);

    System.out.printf(
        "Account budget proposal created: %s.%n", response.getResult().getResourceName());
  }
}
      

C#

public void Run(GoogleAdsClient client, long customerId, long billingSetupId)
{
    // Get the AccountBudgetProposalServiceClient.
    AccountBudgetProposalServiceClient proposalService =
        client.GetService(Services.V17.AccountBudgetProposalService);

    // Create an AccountBudgetProposal. The proposal will be reviewed offline by Google Ads,
    // and if approved will become an AccountBudget.
    AccountBudgetProposal proposal = new AccountBudgetProposal()
    {
        BillingSetup = ResourceNames.BillingSetup(customerId, billingSetupId),
        ProposalType = AccountBudgetProposalType.Create,
        ProposedName = "Account Budget (example)",

        // Specify the account budget starts immediately
        ProposedStartTimeType = TimeType.Now,
        // Alternatively, you can specify a specific start time. Refer to the
        // AccountBudgetProposal resource documentation for allowed formats.
        //
        //ProposedStartDateTime = "2020-01-02 03:04:05",

        // Specify that the budget runs forever.
        ProposedEndTimeType = TimeType.Forever,
        // Alternatively you can specify a specific end time. Allowed formats are as above.
        //ProposedEndDateTime = "2021-02-03 04:05:06",

        // Optional: set notes for the budget. These are free text and do not effect budget
        // delivery.
        //ProposedNotes = "Received prepayment of $0.01",

        // Set the spending limit to 0.01, measured in the Google Ads account currency.
        ProposedSpendingLimitMicros = 10_000

        // Optional: set PO number for record keeping. This value is at the user's
        // discretion, and has no effect on Google Billing & Payments.
        //ProposedPurchaseOrderNumber = "PO number 12345"
    };

    // Create an operation which will add the new AccountBudgetProposal
    AccountBudgetProposalOperation operation = new AccountBudgetProposalOperation()
    {
        Create = proposal
    };

    try
    {
        // Send the request to the Account Budget Proposal Service.
        MutateAccountBudgetProposalResponse response = proposalService.
            MutateAccountBudgetProposal(customerId.ToString(), operation);

        // Display the results.
        Console.WriteLine($"Account budget proposal '{response.Result.ResourceName}' " +
            "was created.");
    }
    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 $billingSetupId
) {
    // Constructs an account budget proposal.
    $accountBudgetProposal = new AccountBudgetProposal([
        'billing_setup' => ResourceNames::forBillingSetup($customerId, $billingSetupId),
        'proposal_type' => AccountBudgetProposalType::CREATE,
        'proposed_name' => 'Account Budget (example)',
        // Specifies the account budget starts immediately.
        'proposed_start_time_type' => TimeType::NOW,
        // Alternatively you can specify a specific start time. Refer to the
        // AccountBudgetProposal class for allowed formats.
        //
        // 'proposed_start_date_time' => '2020-01-02 03:04:05',

        // Specify that the budget runs forever.
        'proposed_end_time_type' => TimeType::FOREVER,
        // Alternatively you can specify a specific end time. Allowed formats are as above.
        // 'proposed_end_date_time' => '2021-02-03 04:05:06',

        // Optional: set notes for the budget. These are free text and do not effect budget
        // delivery.
        // 'proposed_notes' => 'Received prepayment of $0.01',

        // Optional: set PO number for record keeping. This value is at the user's
        // discretion, and has no effect on Google Billing & Payments.
        // 'proposed_purchase_order_number' => 'PO number 12345',

        // Set the spending limit to 0.01, measured in the Google Ads account currency.
        'proposed_spending_limit_micros' => 10000
    ]);

    $accountBudgetProposalOperation = new AccountBudgetProposalOperation();
    $accountBudgetProposalOperation->setCreate($accountBudgetProposal);

    // Issues a mutate request to add the account budget proposal.
    $accountBudgetProposalServiceClient =
        $googleAdsClient->getAccountBudgetProposalServiceClient();
    $response = $accountBudgetProposalServiceClient->mutateAccountBudgetProposal(
        MutateAccountBudgetProposalRequest::build($customerId, $accountBudgetProposalOperation)
    );

    printf(
        "Added an account budget proposal with resource name '%s'.%s",
        $response->getResult()->getResourceName(),
        PHP_EOL
    );
}
      

Python

def main(client, customer_id, billing_setup_id):
    account_budget_proposal_service = client.get_service(
        "AccountBudgetProposalService"
    )
    billing_setup_service = client.get_service("BillingSetupService")

    account_budget_proposal_operation = client.get_type(
        "AccountBudgetProposalOperation"
    )
    proposal = account_budget_proposal_operation.create

    proposal.proposal_type = client.enums.AccountBudgetProposalTypeEnum.CREATE
    proposal.billing_setup = billing_setup_service.billing_setup_path(
        customer_id, billing_setup_id
    )
    proposal.proposed_name = "Account Budget Proposal (example)"

    # Specify the account budget starts immediately
    proposal.proposed_start_time_type = client.enums.TimeTypeEnum.NOW
    # Alternatively you can specify a specific start time. Refer to the
    # AccountBudgetProposal resource documentation for allowed formats.
    #
    # proposal.proposed_start_date_time = '2020-01-02 03:04:05'

    # Specify that the budget runs forever
    proposal.proposed_end_time_type = client.enums.TimeTypeEnum.FOREVER
    # Alternatively you can specify a specific end time. Allowed formats are as
    # above.
    #
    # proposal.proposed_end_date_time = '2021-01-02 03:04:05'

    # Optional: set notes for the budget. These are free text and do not effect
    # budget delivery.
    #
    # proposal.proposed_notes = 'Received prepayment of $0.01'
    proposal.proposed_spending_limit_micros = 10000

    account_budget_proposal_response = (
        account_budget_proposal_service.mutate_account_budget_proposal(
            customer_id=customer_id,
            operation=account_budget_proposal_operation,
        )
    )
    print(
        "Created account budget proposal "
        f'"{account_budget_proposal_response.result.resource_name}".'
    )
      

Ruby

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


  operation = client.operation.create_resource.account_budget_proposal do |proposal|
    proposal.billing_setup = client.path.billing_setup(customer_id, billing_setup_id)
    proposal.proposal_type = :CREATE
    proposal.proposed_name = 'Account Budget (example)'

    # Specify the account budget starts immediately
    proposal.proposed_start_time_type = :NOW
    # Alternatively you can specify a specific start time. Refer to the
    # AccountBudgetProposal resource documentation for allowed formats.
    #
    # proposal.proposed_start_date_time = '2020-01-02 03:04:05'

    # Specify that the budget runs forever.
    proposal.proposed_end_time_type = :FOREVER
    # Alternatively you can specify a specific end time. Allowed formats are as
    # above.
    #
    # proposal.proposed_end_date_time = '2021-01-02 03:04:05'

    # Optional: set notes for the budget. These are free text and do not affect
    # budget delivery.
    #
    # proposal.proposed_notes = 'Received prepayment of $0.01'

    # Set the spending limit to 0.01, measured in the Google Ads account currency.
    proposal.proposed_spending_limit_micros = 10_000
  end

  account_budget_proposal_service = client.service.account_budget_proposal
  # Add budget proposal.
  response = account_budget_proposal_service.mutate_account_budget_proposal(
    customer_id: customer_id,
    operation: operation,
  )

  puts sprintf("Created budget proposal %s.",
      response.results.first.resource_name)
end
      

Perl

sub add_account_budget_proposal {
  my ($api_client, $customer_id, $billing_setup_id) = @_;

  # Create an account budget proposal.
  my $account_budget_proposal =
    Google::Ads::GoogleAds::V17::Resources::AccountBudgetProposal->new({
      billingSetup =>
        Google::Ads::GoogleAds::V17::Utils::ResourceNames::billing_setup(
        $customer_id, $billing_setup_id
        ),
      proposalType => CREATE,
      proposedName => "Account Budget (example)",
      # Specify that the account budget starts immediately.
      proposedStartTimeType => NOW,
      # Alternatively you can specify a specific start time. Refer to the
      # AccountBudgetProposal class for allowed formats.
      #
      # proposedStartDateTime => "2020-01-02 03:04:05",

      # Specify that the account budget runs forever.
      proposedEndDateTime => FOREVER,
      # Alternatively you can specify a specific end time. Allowed formats are as below.
      # proposedEndDateTime => "2021-02-03 04:05:06",

      # Optional: set notes for the budget. These are free text and do not effect budget
      # delivery.
      # proposedNotes => "Received prepayment of $0.01",

      # Optional: set PO number for record keeping. This value is at the user's
      # discretion, and has no effect on Google Billing & Payments.
      # proposedPurchaseOrderNumber => "PO number 12345",

      # Set the spending limit to 0.01, measured in the Google Ads account currency.
      proposedSpendingLimitMicros => 10000
    });

  # Create an account budget proposal operation.
  my $account_budget_proposal_operation =
    Google::Ads::GoogleAds::V17::Services::AccountBudgetProposalService::AccountBudgetProposalOperation
    ->new({
      create => $account_budget_proposal
    });

  # Add the account budget proposal.
  my $account_budget_proposal_response =
    $api_client->AccountBudgetProposalService()->mutate({
      customerId => $customer_id,
      operation  => $account_budget_proposal_operation
    });

  printf "Created account budget proposal '%s'.\n",
    $account_budget_proposal_response->{result}{resourceName};

  return 1;
}
      

खाते के बजट से जुड़े प्रस्तावों के अनुरोधों में, proposed_start_date_time और proposed_end_date_time हमेशा ग्राहक के खाते के टाइमज़ोन में होते हैं. आपके पास टाइमज़ोन तय करने का विकल्प नहीं होता. अनुमानित खर्च की सीमा हमेशा खाते की मुद्रा में मापी जाती है. इसे "माइक्रो" यूनिट का इस्तेमाल करके बताएं, इसलिए 1.00 डॉलर = 10,00,000 माइक्रो डॉलर.

इसके अलावा, आपके पास परचेज़ ऑर्डर (पीओ) नंबर शामिल करने का भी विकल्प है जो इनवॉइस पर इन शुल्कों के बगल में दिखेगा. बजट डिलीवरी पर इसका कोई असर नहीं पड़ता.

लंबित खाता बजट प्रस्ताव को हटाया जा रहा है

खाता बजट प्रस्ताव के संसाधन नाम के साथ AccountBudgetProposalOperation Remove अनुरोध भेजकर, बजट के पूरे प्रस्ताव को हटाया जा सकता है. हालांकि, ध्यान रखें कि बजट प्रस्ताव आम तौर पर कुछ ही मिनटों में लागू हो जाते हैं.

Java
AccountBudgetProposalOperation operation = AccountBudgetProposalOperation.newBuilder()
  .setRemove(StringValue.of(ResourceNames.accountBudgetProposal(customerId, accountBudgetProposalId)))
  .build();

// Send request to Google Ads API (not shown).
C#
AccountBudgetProposalOperation operation = new AccountBudgetProposalOperation()
{
    Remove = ResourceNames.AccountBudgetProposal(customerId, accountBudgetProposalId)
};

// Send request to Google Ads API (not shown).
फ़िलिपीन पेसो
$accountBudgetProposalOperation = new AccountBudgetProposalOperation();
$accountBudgetProposalOperation->setRemove(ResourceNames::forAccountBudgetProposal($customerId, $accountBudgetProposalId));

// Send request to Google Ads API (not shown).
Python
account_budget_proposal_service = client.get_service('AccountBudgetProposalService')
account_budget_proposal_operation = client.get_type('AccountBudgetProposalOperation')
proposal = account_budget_proposal_operation.remove
proposal.resource_name = account_budget_proposal_service.account_budget_proposal_path(customer_id, account_budget_proposal_id):

# Send request to Google Ads API (not shown).
रुबी
operation = client.operation.remove_resource.account_budget_proposal(client.path.account_budget_proposal(customer_id, account_budget_proposal_id))

# Send request to Google Ads API (not shown).
पर्ल
my $account_budget_proposal_operation =
  Google::Ads::GoogleAds::V17::Services::AccountBudgetProposalService::AccountBudgetProposalOperation
    ->new({
      remove => Google::Ads::GoogleAds::V17::Utils::ResourceNames::billing_setup(
          $customer_id, $account_budget_proposal_id
        )
    });

# Send request to Google Ads API (not shown).

अगर आपने मूल प्रस्ताव से कोई गलती की है, तो इसे UPDATE कार्रवाई के तौर पर फिर से सबमिट करें. ज़्यादा जानकारी के लिए, नीचे दिया गया खाते के मौजूदा बजट मैनेज करना सेक्शन देखें.

मौजूदा खाता बजट फिर से पाना

नीचे दी गई GAQL क्वेरी किसी खाते के सभी मौजूदा खाते के बजट फ़ेच करती है:

SELECT
  account_budget.status,
  account_budget.billing_setup,
  account_budget.approved_spending_limit_micros,
  account_budget.approved_spending_limit_type,
  account_budget.proposed_spending_limit_micros,
  account_budget.proposed_spending_limit_type,
  account_budget.adjusted_spending_limit_micros,
  account_budget.adjusted_spending_limit_type,
  account_budget.approved_start_date_time,
  account_budget.proposed_start_date_time,
  account_budget.approved_end_date_time,
  account_budget.approved_end_time_type,
  account_budget.proposed_end_date_time,
  account_budget.proposed_end_time_type
FROM
  account_budget

ध्यान दें कि खाते के बजट का शुरू होने का समय, खत्म होने का समय, और खर्च करने की सीमा वाले फ़ील्ड में proposed और approved जैसे प्रीफ़िक्स वाले कई वैरिएंट होते हैं. इनकी मदद से, शुरुआत में सुझाई गई वैल्यू की तुलना, स्वीकार की गई वैल्यू से की जा सकती है. खर्च की सीमा में adjusted प्रीफ़िक्स वाले अतिरिक्त फ़ील्ड होते हैं. ये फ़ील्ड, मंज़ूरी दी गई रकम में कोई भी बदलाव लागू होने के बाद, लागू होने वाली मौजूदा खर्च की सीमा को दिखाते हैं.

खाते के बजट की मंज़ूरी वाली खर्च की सीमा में, समय के साथ बदलाव किया जा सकता है. ऐसा करके, बजट से ज़्यादा पैसे चुकाने, अमान्य क्लिक पर होने वाली गतिविधि, और प्रमोशन कूपन जैसी चीज़ों के लिए क्रेडिट को बढ़ाया जा सकता है. खाते के बजट, खाते के क्रेडिट, और अडजस्टमेंट के बारे में ज़्यादा जानकारी, Google Ads के सहायता केंद्र पर मिल सकती है.

किसी भी नए खाते के बजट को मंज़ूरी मिलनी बाकी है. साथ ही, खाते के ऐसे मौजूदा बजट जिनमें अपडेट बाकी हैं, उनमें एक pending_proposal फ़ील्ड भी होगा. इस फ़ील्ड को चुना जा सकता है. इसमें, इससे जुड़े AccountBudgetProposal ऑब्जेक्ट का रिसॉर्स आईडी शामिल होगा.

कोड के उदाहरण

हर क्लाइंट लाइब्रेरी के Billing फ़ोल्डर में एक कोड का उदाहरण होता है, जिसमें पूरा अनुरोध दिखता है:

मौजूदा खाता बजट मैनेज करना

ग्राहक के लिए खाते का बजट बनाने के बाद, बजट पैरामीटर मैनेज करने के लिए AccountBudgetProposalService का इस्तेमाल करें. spending_limit और end_date_time फ़ील्ड को अपडेट करना, सबसे सामान्य मैनेजमेंट ऑपरेशन है. बदले जा सकने वाले फ़ील्ड की पूरी सूची देखने के लिए, AccountBudgetProposal दस्तावेज़ देखें.

आपके पास खाते के मौजूदा बजट को अपडेट करने या पूरी तरह से नया बजट बनाने का विकल्प है. ये दोनों विकल्प यहां दिखाए गए हैं.

मौजूदा खाता बजट अपडेट करना

AccountBudgetProposalType वाले AccountBudgetProposal ऑब्जेक्ट को UPDATE पर सेट करके, खाते के मौजूदा बजट फ़ील्ड को अपडेट किया जा सकता है. ध्यान दें कि आपको कार्रवाई के UpdateMask आर्ग्युमेंट में, अपडेट किए जा रहे फ़ील्ड की जानकारी भी देनी होगी.

नीचे दिया गया स्निपेट बताता है कि खाते के मौजूदा बजट के लिए, खर्च की सुझाई गई सीमा को कैसे अपडेट करें.

Java
AccountBudgetProposal proposal = AccountBudgetProposal.newBuilder()
  .setProposalType(AccountBudgetProposalType.UPDATE)
  .setAccountBudget(accountBudget.getResourceName())
  .setProposedSpendingLimitMicros(
    accountBudget.getProposedSpendingLimitMicros().getValue() + increaseAmount)
  .build();

AccountBudgetProposalOperation operation = AccountBudgetProposalOperation.newBuilder()
  .setCreate(proposal)
  .setUpdateMask(
      FieldMask.newBuilder().addAllPaths(Arrays.asList("proposed_spending_limit")).build())
  .build();

// Send request to Google Ads API (not shown).
C#
AccountBudgetProposal proposal = new AccountBudgetProposal()
{
  ProposalType = AccountBudgetProposalType.Update,
  AccountBudget = accountBudget.ResourceName,
  ProposedSpendingLimitMicros = accountBudget.ProposedSpendingLimitMicros + increaseAmount
};

AccountBudgetProposalOperation operation = new AccountBudgetProposalOperation()
{
  Create = proposal,
  UpdateMask = new FieldMask()
  {
    Paths = { "proposed_spending_limit" }
  }
};

// Send request to Google Ads API (not shown).
फ़िलिपीन पेसो
$accountBudgetProposal = new AccountBudgetProposal([
  'proposal_type' => AccountBudgetProposalType::UPDATE,
  'account_budget' => $accountBudget->getResourceName(),
  'proposed_spending_limit_micros' =>
    $accountBudget->getProposedSpendingLimitMicros() + $increaseAmount])

$accountBudgetProposalOperation = new AccountBudgetProposalOperation();
$accountBudgetProposalOperation->setCreate($accountBudgetProposal);
$accountBudgetProposalOperation->setUpdateMask(
  FieldMasks::allSetFieldsOf($accountBudgetProposal)
);

// Send request to Google Ads API (not shown).
Python
account_budget_proposal_operation = client.get_type('AccountBudgetProposalOperation')

proposal = account_budget_proposal_operation.create
proposal.proposal_type = client.get_type('AccountBudgetProposalTypeEnum').UPDATE
proposal.account_budget = account_budget
proposal.proposed_spending_limit_micros = account_budget.proposed_spending_limit_micros + increase_amount

field_mask = protobuf_helpers.field_mask(None, proposal)
account_budget_proposal_operation.update_mask.CopyFrom(field_mask)

# Send request to Google Ads API (not shown).
रुबी
proposal = client.resource.account_budget_proposal
proposal.proposal_type = :UPDATE

mask = client.field_mask.with proposal do
  proposal.account_budget = account_budget.resource_name
  proposal.proposed_spending_limit_micros = account_budget.proposed_spending_limit_micros + increase_amount
end

operation = client.operation.account_budget_proposal do |op|
  op.create = proposal
  op.update_mask = mask
end

# Send request to Google Ads API (not shown).
पर्ल
my $account_budget_proposal =
  Google::Ads::GoogleAds::V17::Resources::AccountBudgetProposal->new({
    proposalType => UPDATE,
    accountBudget => $account_budget->{resourceName},
    proposedSpendingLimitMicros => $account_budget->{proposedSpendingLimitMicros} + $increaseAmount});

my $account_budget_proposal_operation =
  Google::Ads::GoogleAds::V17::Services::AccountBudgetProposalService::AccountBudgetProposalOperation
    ->new({
      create => $account_budget_proposal,
      updateMask => all_set_fields_of($account_budget_proposal)});

# Send request to Google Ads API (not shown).

खाते की बजट चेन बनाना

मौजूदा बजट को अपडेट करने के बजाय, Google Ads आपको कई खातों के बजट को एक साथ चलाने में मदद करता है. नीचे दिए गए उदाहरण में, ग्राहक ने हर महीने अलग-अलग खर्च की सीमाएं तय की हैं.

ऐसा तीन AccountBudgetProposal ऑब्जेक्ट बनाकर और उन्हें AccountBudgetProposalService पर भेजकर किया जा सकता है.

नीचे दिए गए स्निपेट में मौजूदा बिलिंग सेटअप का इस्तेमाल करके, ऐसी चेन बनाने के बारे में बताया गया है.

Java
AccountBudgetProposal proposalMay = AccountBudgetProposal.newBuilder()
  .setBillingSetup(ResourceNames.billingSetup(customerId, billingSetupId))
  .setProposalType(AccountBudgetProposalType.CREATE)
  .setProposedName("May budget")
  .setProposedStartDateTime("2018-05-01")
  .setProposedEndDateTime("2018-06-01")
  .setProposedSpendingLimitMicros(1_000_000_000L)
  .build();

AccountBudgetProposal proposalJune = AccountBudgetProposal.newBuilder()
  .setBillingSetup(ResourceNames.billingSetup(customerId, billingSetupId))
  .setProposalType(AccountBudgetProposalType.CREATE)
  .setProposedName("June budget")
  .setProposedStartDateTime("2018-06-01")
  .setProposedEndDateTime("2018-07-01")
  .setProposedSpendingLimitMicros(5_000_000_000L)
  .build();

AccountBudgetProposal proposalJuly = AccountBudgetProposal.newBuilder()
  .setBillingSetup(ResourceNames.billingSetup(customerId, billingSetupId))
  .setProposalType(AccountBudgetProposalType.CREATE)
  .setProposedName("July budget")
  .setProposedStartDateTime("2018-07-01")
  .setProposedEndDateTime("2018-08-01")
  .setProposedSpendingLimitMicros(1_000_000_000L)
  .build();

// Send request to Google Ads API (not shown).
C#
AccountBudgetProposal proposalMay = new AccountBudgetProposal()
{
  BillingSetup = ResourceNames.BillingSetup(customerId, billingSetupId),
  ProposalType = AccountBudgetProposalType.Create,
  ProposedName = "May budget",
  ProposedStartDateTime = "2018-05-01",
  ProposedEndDateTime = "2018-06-01",
  ProposedSpendingLimitMicros = 1_000_000_000
}

AccountBudgetProposal proposalJune = new AccountBudgetProposal()
{
  BillingSetup = ResourceNames.BillingSetup(customerId, billingSetupId),
  ProposalType = AccountBudgetProposalType.Create,
  ProposedName = "June budget",
  ProposedStartDateTime = "2018-06-01",
  ProposedEndDateTime = "2018-07-01",
  ProposedSpendingLimitMicros = 5_000_000_000
}

AccountBudgetProposal proposalJuly = new AccountBudgetProposal()
{
  BillingSetup = ResourceNames.BillingSetup(customerId, billingSetupId),
  ProposalType = AccountBudgetProposalType.Create,
  ProposedName = "July budget",
  ProposedStartDateTime = "2018-07-01",
  ProposedEndDateTime = "2018-08-01",
  ProposedSpendingLimitMicros = 1_000_000_000
}

// Send request to Google Ads API (not shown).
फ़िलिपीन पेसो
$proposalMay = new AccountBudgetProposal([
  'billing_setup' => ResourceNames::forBillingSetup($customerId, $billingSetupId),
  'proposal_type' => AccountBudgetProposalType::CREATE,
  'proposed_name' => 'May budget',
  'proposed_start_date_time' => '2018-05-01',
  'proposed_end_date_time' => '2018-06-01',
  'proposed_spending_limit_micros' => 1000000000
]);

$proposalJune = new AccountBudgetProposal([
  'billing_setup' => ResourceNames::forBillingSetup($customerId, $billingSetupId),
  'proposal_type' => AccountBudgetProposalType::CREATE,
  'proposed_name' => 'June budget',
  'proposed_start_date_time' => '2018-06-01',
  'proposed_end_date_time' => '2018-07-01',
  'proposed_spending_limit_micros' => 5000000000
]);

$proposalJuly = new AccountBudgetProposal([
  'billing_setup' => ResourceNames::forBillingSetup($customerId, $billingSetupId),
  'proposal_type' => AccountBudgetProposalType::CREATE,
  'proposed_name' => 'July budget',
  'proposed_start_date_time' => '2018-07-01',
  'proposed_end_date_time' => '2018-08-01',
  'proposed_spending_limit_micros' => 1000000000
]);

// Send request to Google Ads API (not shown).
Python
may_account_budget_proposal_operation = client.get_type('AccountBudgetProposalOperation')
proposalMay = may_account_budget_proposal_operation.create
proposalMay.proposal_type = client.get_type('AccountBudgetProposalTypeEnum').CREATE
proposalMay.billing_setup = billing_setup_service.billing_setup_path(customer_id, billing_setup_id)
proposalMay.proposed_name = 'May budget'
proposalMay.proposed_start_date_time = '2018-05-01'
proposalMay.proposed_end_date_time = '2018-06-01'
proposalMay.proposed_spending_limit_micros = 1000000000

june_account_budget_proposal_operation = client.get_type('AccountBudgetProposalOperation')
proposalJune = may_account_budget_proposal_operation.create
proposalJune.proposal_type = client.get_type('AccountBudgetProposalTypeEnum').CREATE
proposalJune.billing_setup = billing_setup_service.billing_setup_path(customer_id, billing_setup_id)
proposalJune.proposed_name = 'June budget'
proposalJune.proposed_start_date_time = '2018-06-01'
proposalJune.proposed_end_date_time = '2018-07-01'
proposalJune.proposed_spending_limit_micros = 5000000000

july_account_budget_proposal_operation = client.get_type('AccountBudgetProposalOperation')
proposalJuly = may_account_budget_proposal_operation.create
proposalJuly.proposal_type = client.get_type('AccountBudgetProposalTypeEnum').CREATE
proposalJuly.billing_setup = billing_setup_service.billing_setup_path(customer_id, billing_setup_id)
proposalJuly.proposed_name = 'July budget'
proposalJuly.proposed_start_date_time = '2018-07-01'
proposalJuly.proposed_end_date_time = '2018-08-01'
proposalJuly.proposed_spending_limit_micros = 1000000000

# Send request to Google Ads API (not shown).
रुबी
proposal_may = client.operation.create_resource.account_budget_proposal do |proposal|
  proposal.billing_setup = client.path.billing_setup(customer_id, billing_setup_id)
  proposal.proposal_type = :CREATE
  proposal.proposed_name = 'May budget'
  proposal.proposed_start_date_time = '2018-05-01'
  proposal.proposed_end_date_time = '2018-06-01'
  proposal.proposed_spending_limit_micros = 1_000_000_000
end

proposal_june = client.operation.create_resource.account_budget_proposal do |proposal|
  proposal.billing_setup = client.path.billing_setup(customer_id, billing_setup_id)
  proposal.proposal_type = :CREATE
  proposal.proposed_name = 'June budget'
  proposal.proposed_start_date_time = '2018-06-01'
  proposal.proposed_end_date_time = '2018-07-01'
  proposal.proposed_spending_limit_micros = 5_000_000_000
end

proposal_july = client.operation.create_resource.account_budget_proposal do |proposal|
  proposal.billing_setup = client.path.billing_setup(customer_id, billing_setup_id)
  proposal.proposal_type = :CREATE
  proposal.proposed_name = 'July budget'
  proposal.proposed_start_date_time = '2018-07-01'
  proposal.proposed_end_date_time = '2018-08-01'
  proposal.proposed_spending_limit_micros = 1_000_000_000
end

# Send request to Google Ads API (not shown).
पर्ल
my $may_proposal =
  Google::Ads::GoogleAds::V17::Resources::AccountBudgetProposal->new({
    billingSetup =>
      Google::Ads::GoogleAds::V17::Utils::ResourceNames::billing_setup(
      $customer_id, $billing_setup_id
      ),
    proposalType => CREATE,
    proposedName => "May budget",
    proposedStartDateTime => "2018-05-01",
    proposedEndDateTime => "2018-06-01",
    proposedSpendingLimitMicros => 1000000000
  });

my $june_proposal =
  Google::Ads::GoogleAds::V17::Resources::AccountBudgetProposal->new({
    billingSetup =>
      Google::Ads::GoogleAds::V17::Utils::ResourceNames::billing_setup(
      $customer_id, $billing_setup_id
      ),
    proposalType => CREATE,
    proposedName => "June budget",
    proposedStartDateTime => "2018-06-01",
    proposedEndDateTime => "2018-07-01",
    proposedSpendingLimitMicros => 5000000000
  });

my $july_proposal =
  Google::Ads::GoogleAds::V17::Resources::AccountBudgetProposal->new({
    billingSetup =>
      Google::Ads::GoogleAds::V17::Utils::ResourceNames::billing_setup(
      $customer_id, $billing_setup_id
      ),
    proposalType => CREATE,
    proposedName => "July budget",
    proposedStartDateTime => "2018-07-01",
    proposedEndDateTime => "2018-08-01",
    proposedSpendingLimitMicros => 1000000000
  });

# Send request to Google Ads API (not shown).

हर प्रस्ताव में AccountBudgetProposalType.CREATE के इस्तेमाल का ध्यान रखें. इससे एक ही बजट को तीन बार अपडेट करने के बजाय, तीन अलग-अलग बजट बनेंगे.

खाता बजट खत्म करना

खाते के बजट को चालू रहते हुए खत्म किया जा सकता है. साथ ही, इसे शुरू होने से पहले या मंज़ूरी मिलने के दौरान, पूरी तरह से हटाया जा सकता है.

खाते का चालू बजट खत्म करना

सक्रिय खाते का बजट निकाला नहीं जा सकता. हालांकि, आपके पास खत्म होने का समय मौजूदा समय पर सेट करने का विकल्प है. ऐसा करने का सबसे आसान तरीका यह है कि AccountBudgetProposalType.END का इस्तेमाल करके प्रस्ताव भेजा जाए.

नीचे दिए गए स्निपेट में खाते के मौजूदा बजट को खत्म करने का तरीका बताया गया है.

Java
AccountBudgetProposal.newBuilder()
  .setProposalType(AccountBudgetProposalType.END)
  .setAccountBudget(accountBudget.getResourceName())
  .build();

// Send request to Google Ads API (not shown).
C#
AccountBudgetProposal proposal = new AccountBudgetProposal()
{
  ProposalType = AccountBudgetProposalType.End,
  AccountBudget = accountBudget.ResourceName
};

// Send request to Google Ads API (not shown).
फ़िलिपीन पेसो
$accountBudgetProposal = new AccountBudgetProposal([
  'proposal_type' => AccountBudgetProposalType::END,
  'account_budget' => $accountBudget->getResourceName()
])

// Send request to Google Ads API (not shown).
Python
account_budget_proposal_operation = client.get_type('AccountBudgetProposalOperation')
proposal = account_budget_proposal_operation.create
proposal.proposal_type = client.get_type('AccountBudgetProposalTypeEnum').END
proposal.account_budget = account_budget

# Send request to Google Ads API (not shown).
रुबी
proposal = client.resource.account_budget_proposal
proposal.proposal_type = :END
proposal.account_budget = account_budget.resource_name

# Send request to Google Ads API (not shown).
पर्ल
my $account_budget_proposal =
  Google::Ads::GoogleAds::V17::Resources::AccountBudgetProposal->new({
    proposalType => END,
    accountBudget => $account_budget->{resourceName});

# Send request to Google Ads API (not shown).

यह, खत्म होने की तारीख को TimeType.NOW पर सेट करके, खाते का बजट अपडेट करने के बराबर है.

मंज़ूरी पा चुके खाते का बजट, शुरू होने के समय से पहले हटाना

अगर आपने आने वाले समय में किसी खाते के बजट का सुझाव दिया है, तो शुरू होने के समय से पहले ही उसे हटा दिया जा सकता है. इसके लिए, आपको प्रस्ताव का टाइप AccountBudgetProposalType.REMOVE भेजना होगा.

नीचे दिया गया स्निपेट, खाते के मौजूदा बजट को हटाने के बारे में बताता है.

Java
AccountBudgetProposal.newBuilder()
  .setProposalType(AccountBudgetProposalType.REMOVE)
  .setAccountBudget(accountBudget.getResourceName())
  .build();

// Send request to Google Ads API (not shown).
C#
AccountBudgetProposal proposal = new AccountBudgetProposal()
{
  ProposalType = AccountBudgetProposalType.Remove,
  AccountBudget = accountBudget.ResourceName
};

// Send request to Google Ads API (not shown).
फ़िलिपीन पेसो
$accountBudgetProposal = new AccountBudgetProposal([
  'proposal_type' => AccountBudgetProposalType::REMOVE,
  'account_budget' => $accountBudget->getResourceName()
])

// Send request to Google Ads API (not shown).
Python
account_budget_proposal_operation = client.get_type('AccountBudgetProposalOperation')
proposal = account_budget_proposal_operation.create
proposal.proposal_type = client.get_type('AccountBudgetProposalTypeEnum').REMOVE
proposal.account_budget = account_budget

# Send request to Google Ads API (not shown).
रुबी
proposal = client.resource.account_budget_proposal
proposal.proposal_type = :REMOVE
proposal.account_budget = account_budget.resource_name

# Send request to Google Ads API (not shown).
पर्ल
my $account_budget_proposal =
  Google::Ads::GoogleAds::V17::Resources::AccountBudgetProposal->new({
    proposalType => REMOVE,
    accountBudget => $account_budget->{resourceName});

# Send request to Google Ads API (not shown).