Best way to pause a campaign immediately

43 views
Skip to first unread message

custom...@canadaleads.ca

unread,
Aug 18, 2020, 7:02:27 PM8/18/20
to AdWords API and Google Ads API Forum
Hi - I'd like to pause an adwords campaign when certain conditions are met e.g. when a counter has reached a limit in a Google sheet. The condition checking is solved but is there some example code using http calls (to Soap etc.) to actually pause a campaign?

I did look at Adwords scripts but they run hourly which is not appropriate for my use case, as I want to stop a campaign instantly - so I suspect I need to use the API.




Google Ads API Forum Advisor Prod

unread,
Aug 19, 2020, 3:20:57 PM8/19/20
to adwor...@googlegroups.com
Hello,

Unfortunately, the API cannot fetch results in real-time. The best option for you is to use Google Ads Scripts like you've been using. 

Regards,
Anthony
Google Ads API Team

ref:_00D1U1174p._5004Q23LKW9:ref

custom...@canadaleads.ca

unread,
Aug 19, 2020, 3:25:52 PM8/19/20
to AdWords API and Google Ads API Forum
Hi - I wasn't asking if the API can fetch results. Sorry if it wasn't clear. I asked if via the API I can pause/restart a campaign. e.g. if I set up a php/web service to do this and have that web service authorized and using my API key to manage a campaign? I then call my web service and pass it the campaign name and command e.g. "Pause" or "Resume". I just need some sample (php preferred) code for this if you know any.

Google Ads API Forum Advisor Prod

unread,
Aug 19, 2020, 4:53:43 PM8/19/20
to adwor...@googlegroups.com
Hi,

Here is an example on how to pause a campaign. In this example, the campaign is selected by its Id. You can modify the code to pass the name instead.

custom...@canadaleads.ca

unread,
Aug 19, 2020, 6:29:46 PM8/19/20
to AdWords API and Google Ads API Forum
Thanks Anthony!
Reply all
Reply to author
Forward
0 new messages