Pause AdGroups if the item in Ad is out of stock

13 views
Skip to first unread message

Tomáš Kunickij

unread,
Jun 17, 2019, 5:16:43 PM6/17/19
to AdWords API and Google Ads API Forum
Hello everyone,

I am connected to my clients account via API by Python {from googleads import adwords}.
I would like to ask what is the best way to do this.

I need to work only in campaigns with exact names i know.
Then i need to iterate over each AdGroup.
In Each AdGroup i need to get the URL of each Ad.
My python function tells me, if the item is out of stock.
In this case i need to pause the whole AdGroup in which the Ad is.

What is the best way please?
The code helps me too, i am new to adwords API.

Thanks.

Google Ads API Forum Advisor Prod

unread,
Jun 18, 2019, 3:07:48 AM6/18/19
to adwor...@googlegroups.com

Hi Tomáš,

You may use AdGroupService with filtering campaignId or campaignName to get specific adGroups. As for getting the Ad information, you will need to make a separate request using the AdGroupAdService. You may then use the following to get URLs of the ads.

You may also use Ad Performance Report as it is possible to retrieve the similar information with the above by filtering CampaignId or CampaignName.

With regard to pausing adGroups, it is possible to use AdGroupAdService.mutate and update the status to PAUSED. You may also refer to this sample for updating adGroups.

Please let me know if you have further concerns.

Regards,
Hiroyuki
Google Ads API Team



ref:_00D1U1174p._5001UBnq70:ref
Reply all
Reply to author
Forward
0 new messages