Ended campaigns returned with condition Status = ENABLED

605 views
Skip to first unread message

Tomas Kapler

unread,
Jun 4, 2013, 11:16:10 AM6/4/13
to adwords...@googlegroups.com
When i use a campaign iterator with condition "Status = ENABLED"

 var campaignIterator = AdWordsApp.campaigns()
      
.withCondition("Status = ENABLED")

it returns also ended campaigns as Status recognise only PAUSED / ENABLED statuses, what is wrong. But at least it can be now solved with getEndDate condition inside iterator

Kevin Winter (AdWords Scripts Team)

unread,
Jun 6, 2013, 9:26:38 AM6/6/13
to adwords...@googlegroups.com
Technically, an ended campaign is still ENABLED, therefore it doesn't get filtered out.

- Kevin Winter
AdWords Scripts Team

Rafał Ciok

unread,
Sep 1, 2017, 5:09:21 AM9/1/17
to AdWords Scripts Forum
This is so annoying. Google, please add status ENDED, pls pls pls

Rafał Ciok

unread,
Sep 1, 2017, 5:15:45 AM9/1/17
to AdWords Scripts Forum
Kevin, do something about that. Scripts would get so much more precise. In Adwords UI ENDED is excluded from ENABLE - why Adwords scripts does not work this way?

Anthony Madrigal

unread,
Sep 1, 2017, 9:24:58 AM9/1/17
to AdWords Scripts Forum
Hi Rafal,

You can use a withCondition on the field ServingStatus to filter out campaigns that have ended.

Regards,
Anthony
AdWords Scripts Team

Rafał Ciok

unread,
Sep 4, 2017, 4:32:17 AM9/4/17
to AdWords Scripts Forum on behalf of Anthony Madrigal
Hi Kevin,
Thanks for this hint - I didn't know about this, but I solves my problem partially since ServingStatus is available for AdWordsApp.report query, while most of my scripts are based on selectors .get()

If no other option I will have to use IF-clause for .getEndDate().




  
Rafał Ciok
SEM Expert

514 945 614
r.c...@salestube.pl
www.salestube.pl




Al. Jerozolimskie 134
02-305 Warszawa
NIP 521 354 68 72
 Wiodąca niezależna polska grupa komunikacyjna wg raportu w www.leadingindependents.com


--
-- You received this message because you are subscribed to the Google Groups AdWords Scripts Forum group. Please do not reply to this email. To post to this group or unsubscribe please visit https://developers.google.com/adwords/scripts/community.
---
You received this message because you are subscribed to a topic in the Google Groups "AdWords Scripts Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-scripts/ISJkHda1jss/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-scripts+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-scripts/b4f3e3dc-c37f-4299-91b9-03246ed8995c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Thea Vega (AdWords Scripts Team)

unread,
Sep 4, 2017, 6:42:02 AM9/4/17
to AdWords Scripts Forum
Hi Rafal,

That's right, you may also use .getEndDate() in an if clause to get ended campaigns by comparing the date today with the .getEndDate() method.

Thanks,
Thea
AdWords Scripts Team

Tina Arnoldi

unread,
Jun 6, 2018, 1:54:41 PM6/6/18
to AdWords Scripts Forum
Would that be written as 

.withCondition("ServingStatus = Enabled");

Hiroyuki Miyauchi (AdWords Scripts Team)

unread,
Jun 7, 2018, 12:01:30 AM6/7/18
to AdWords Scripts Forum
Hello,

The predicate values for ServingStatus are SERVINGNONEENDEDPENDING and SUSPENDED as seen in the guide (I would suggest that checking display values as well). If you want to filter by enabled campaigns, you may use SERVING as seen in the sample code snippet below. 

var campaignIterator = AdWordsApp.campaigns().withCondition("ServingStatus = SERVING").get();

Since this is an old thread, feel free to open a new thread so we can track this on our end better.

Regards,
Hiroyuki
AdWords Scripts Team
Reply all
Reply to author
Forward
0 new messages