Ask Your Question

What is the process for halting and continuing adgroups in Google Adwords Display using API (Python)?

asked 2021-08-20 11:00:00 +0000

ladyg gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2022-02-10 13:00:00 +0000

djk gravatar image

The process for halting and continuing ad groups in Google Adwords Display using API (Python) involves the following steps:

  1. First, you need to authenticate your account with the AdWords API by creating an OAuth2 client ID and secret.

  2. Then, you need to install the Google AdWords API client library in your Python environment.

  3. After that, you can use the AdWords API to fetch a list of ad groups that you want to halt or continue. You can do this by using the "AdGroupService" and "ManagedCustomerService" classes in the API.

  4. Once you have fetched the list of ad groups, you can iterate through them and use the "AdGroupService" to pause or enable them as required. You can do this by setting the "status" field of the ad group object to "PAUSED" or "ENABLED" respectively.

  5. Finally, you need to update the ad groups by using the "AdGroupService" again to push the changes to your AdWords account.

Here is an example code snippet that demonstrates how to pause an ad group using the AdWords API in Python:

from googleads import adwords

# Authenticate with the API using OAuth2
adwords_client = adwords.AdWordsClient.LoadFromStorage()

# Fetch a list of ad groups that need to be paused
ad_group_service = adwords_client.GetService('AdGroupService', version='v201809')
ad_groups = ad_group_service.get({'status': 'ENABLED'})

# Iterate through the ad groups and pause them
for ad_group in ad_groups:
    ad_group.status = 'PAUSED'

# Update the changes to the AdWords account
adwords_client.GetService('CampaignService', version='v201809').mutate(campaign_operations)

To continue an ad group, you can simply set the "status" field to "ENABLED" and follow the same process to update the changes to your AdWords account.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer

Question Tools


Asked: 2021-08-20 11:00:00 +0000

Seen: 12 times

Last updated: Feb 10 '22