create a draft and pause all Ads

18 views
Skip to first unread message

Imran Tufail

unread,
Nov 4, 2016, 4:02:18 AM11/4/16
to AdWords API Forum

Hi, I want to create a draft and want all my Ads in this draft campaign to be pause. Is there any api to pause all Ads in a draft campaign ?

Joyce Lava

unread,
Nov 4, 2016, 4:43:34 AM11/4/16
to AdWords API Forum
Hello Imran,

You can refer to this example code on how to create a draft campaign. Once you have that, it will serve as a mirror of the base campaign, that said, you need to use the draftCampaignId if you wish to update an entity under the draft campaign (e.g. update the status of its ads). To do so, you may use the AdGroupAdService.mutate operation. The steps may be as follows:

1. Get the adGroups under the draft campaign using draftCampaignId. An example code can be found here.
2. Get the ads under the adGroup found in #1 using the adGroupId returned. An example code that shows how to get an ad (e.g. ExpandedTextAd) in an adGroup is here.
3. Pause the ad using the adGroupId returned in #1 and adId returned in #2. An example code to pause an ad is available here.

Other client libraries are available here.

Regards,
Joyce, AdWords API Team
Reply all
Reply to author
Forward
0 new messages