कैंपेन के बजट बनाना

बजट दो तरह के होते हैं: रोज़ के औसत बजट और कैंपेन के कुल बजट. CampaignBudgetService का इस्तेमाल करके, इनमें से कोई भी बजट बनाया जा सकता है.

रोज़ का औसत बजट बनाना

यह वह औसत रकम है जिसे आपको किसी कैंपेन के लिए हर दिन खर्च करना है. रोज़ का औसत बजट सेट किया जा सकता है. amount_micros CampaignBudget बजट period डिफ़ॉल्ट रूप से DAILY पर सेट होता है.

explicitly_shared की वैल्यू डिफ़ॉल्ट रूप से truecreate पर सेट होती है. इसलिए, किसी एक कैंपेन के लिए शेयर नहीं किया गया बजट बनाने के लिए, आपको explicitly_shared की वैल्यू को false पर सेट करना होगा. यहां दिया गया उदाहरण देखें:

Java

private static String addCampaignBudget(GoogleAdsClient googleAdsClient, long customerId) {
  CampaignBudget budget =
      CampaignBudget.newBuilder()
          .setName("Interplanetary Cruise Budget #" + getPrintableDateTime())
          .setDeliveryMethod(BudgetDeliveryMethod.STANDARD)
          .setAmountMicros(500_000)
          .build();

  CampaignBudgetOperation op = CampaignBudgetOperation.newBuilder().setCreate(budget).build();

  try (CampaignBudgetServiceClient campaignBudgetServiceClient =
      googleAdsClient.getLatestVersion().createCampaignBudgetServiceClient()) {
    MutateCampaignBudgetsResponse response =
        campaignBudgetServiceClient.mutateCampaignBudgets(
            Long.toString(customerId), ImmutableList.of(op));
    String budgetResourceName = response.getResults(0).getResourceName();
    System.out.printf("Added budget: %s%n", budgetResourceName);
    return budgetResourceName;
  }
}
      

C#

private static string CreateBudget(GoogleAdsClient client, long customerId)
{
    // Get the BudgetService.
    CampaignBudgetServiceClient budgetService = client.GetService(
        Services.V26.CampaignBudgetService);

    // Create the campaign budget.
    CampaignBudget budget = new CampaignBudget()
    {
        Name = "Interplanetary Cruise Budget #" + ExampleUtilities.GetRandomString(),
        DeliveryMethod = BudgetDeliveryMethod.Standard,
        AmountMicros = 500000
    };

    // Create the operation.
    CampaignBudgetOperation budgetOperation = new CampaignBudgetOperation()
    {
        Create = budget
    };

    // Create the campaign budget.
    MutateCampaignBudgetsResponse response = budgetService.MutateCampaignBudgets(
        customerId.ToString(), new CampaignBudgetOperation[] { budgetOperation });
    return response.Results[0].ResourceName;
}
      

PHP

private static function addCampaignBudget(GoogleAdsClient $googleAdsClient, int $customerId)
{
    // Creates a campaign budget.
    $budget = new CampaignBudget([
        'name' => 'Interplanetary Cruise Budget #' . Helper::getPrintableDatetime(),
        'delivery_method' => BudgetDeliveryMethod::STANDARD,
        'amount_micros' => 500000
    ]);

    // Creates a campaign budget operation.
    $campaignBudgetOperation = new CampaignBudgetOperation();
    $campaignBudgetOperation->setCreate($budget);

    // Issues a mutate request.
    $campaignBudgetServiceClient = $googleAdsClient->getCampaignBudgetServiceClient();
    $response = $campaignBudgetServiceClient->mutateCampaignBudgets(
        MutateCampaignBudgetsRequest::build($customerId, [$campaignBudgetOperation])
    );

    /** @var CampaignBudget $addedBudget */
    $addedBudget = $response->getResults()[0];
    printf("Added budget named '%s'%s", $addedBudget->getResourceName(), PHP_EOL);

    return $addedBudget->getResourceName();
}
      

Python

# Create a budget, which can be shared by multiple campaigns.
campaign_budget_operation: CampaignBudgetOperation = client.get_type(
    "CampaignBudgetOperation"
)
campaign_budget: CampaignBudget = campaign_budget_operation.create
campaign_budget.name = f"Interplanetary Budget {uuid.uuid4()}"
campaign_budget.delivery_method = (
    client.enums.BudgetDeliveryMethodEnum.STANDARD
)
campaign_budget.amount_micros = 500000

# Add budget.
campaign_budget_response: MutateCampaignBudgetsResponse
try:
    budget_operations: List[CampaignBudgetOperation] = [
        campaign_budget_operation
    ]
    campaign_budget_response = (
        campaign_budget_service.mutate_campaign_budgets(
            customer_id=customer_id,
            operations=budget_operations,
        )
    )
except GoogleAdsException as ex:
    handle_googleads_exception(ex)
      

Ruby

# Create a budget, which can be shared by multiple campaigns.
campaign_budget = client.resource.campaign_budget do |cb|
  cb.name = "Interplanetary Budget #{(Time.new.to_f * 1000).to_i}"
  cb.delivery_method = :STANDARD
  cb.amount_micros = 500000
end

operation = client.operation.create_resource.campaign_budget(campaign_budget)

# Add budget.
return_budget = client.service.campaign_budget.mutate_campaign_budgets(
  customer_id: customer_id,
  operations: [operation],
)
      

Perl

# Create a campaign budget, which can be shared by multiple campaigns.
my $campaign_budget =
  Google::Ads::GoogleAds::V26::Resources::CampaignBudget->new({
    name           => "Interplanetary budget #" . uniqid(),
    deliveryMethod => STANDARD,
    amountMicros   => 500000
  });

# Create a campaign budget operation.
my $campaign_budget_operation =
  Google::Ads::GoogleAds::V26::Services::CampaignBudgetService::CampaignBudgetOperation
  ->new({create => $campaign_budget});

# Add the campaign budget.
my $campaign_budgets_response = $api_client->CampaignBudgetService()->mutate({
    customerId => $customer_id,
    operations => [$campaign_budget_operation]});
      

curl

कैंपेन का कुल बजट बनाना

यह वह कुल रकम है जिसे आपको कैंपेन की पूरी अवधि के दौरान खर्च करना है. कैंपेन का कुल बजट बनाने के लिए, बजट period को CUSTOM_PERIOD और सेट total_amount_micros. कैंपेन के कुल बजट को एक से ज़्यादा कैंपेन के साथ शेयर नहीं किया जा सकता. इसलिए, बजट periodCUSTOM_PERIOD बनाते समय, आपको explicitly_shared की वैल्यू को false पर सेट करना होगा.

कोडिंग करते समय, फ़ील्ड वही होते हैं जो रोज़ के औसत बजट के लिए होते हैं. हालांकि, period और total_amount_micros फ़ील्ड अलग होते हैं.

कैंपेन के बजट के लिए सुझाव

Google Ads API, कैंपेन के बजट को ऑप्टिमाइज़ करने में आपकी मदद करने के लिए, कई तरह के सुझाव देता है:

  • CAMPAIGN_BUDGET की मदद से, सीमित बजट वाले कैंपेन के लिए नया बजट सुझाया जाता है.

  • MOVE_UNUSED_BUDGET की मदद से, एक कैंपेन के बचे हुए बजट को दूसरे सीमित बजट वाले कैंपेन में फिर से बांटने के अवसरों को हाइलाइट किया जाता है.

  • MARGINAL_ROI_CAMPAIGN_BUDGET की मदद से, उन कैंपेन के लिए नया बजट सुझाया जाता है जिनका आरओआई, बजट में बदलाव करने पर बढ़ने का अनुमान है.

  • FORECASTING_CAMPAIGN_BUDGET की मदद से, उन कैंपेन के लिए नया बजट सुझाया जाता है जिनके लिए आने वाले समय में सीमित बजट की ज़रूरत पड़ सकती है.

Google Ads API में, सुझावों के अन्य टाइप और उन्हें इस्तेमाल करने के बारे में जानने के लिए , ऑप्टिमाइज़ेशन स्कोर और सुझावों की गाइड पर जाएं.