Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Google Ads API failing

I am working with Google Ads and taking look in the documentation to see how to code a campaign.

from google.ads.google_ads.client import GoogleAdsClient

def create_campaign(google_ads_client, campaign_name, budget_micros):
    campaign_operation = google_ads_client.service.campaign.create(
        customer_id="YOUR_CUSTOMER_ID",
        campaign={
            "name": campaign_name,
            "advertising_channel_type": "SEARCH",
            "status": "PAUSED",
            "manual_cpc": {
                "enhanced_cpc_enabled": True
            },
            "campaign_budget": {
                "amount_micros": budget_micros
            },
            "network_settings": {
                "target_google_search": True,
                "target_search_network": True,
                "target_content_network": False,
                "target_partner_search_network": False
            }
        }
    )

    # Execute the campaign operation
    response = campaign_operation.execute()

    # Print the created campaign's resource name
    print("Created campaign with resource name: " + response.resource_name)

# Set up the Google Ads API client
google_ads_client = GoogleAdsClient.load_from_storage()

# Define the campaign details
campaign_name = "My Campaign"
budget_micros = 5.000000  

The error raised with macro budget and I don’t know what is this, I tried set the number based on what documentation suggesting and still don’t understand it

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Looking into the Docs it says:

The amount of the budget, in the local currency for the account. Amount is specified in micros, where one million is equivalent to one currency unit. Monthly spend is capped at 30.4 times this amount.

so this means how much you will spend on your Ad/campaign.
Why did you add a point in the budget_micros variable? I assume it must be budget_micros = 5000000 ?

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading