Why does the budget field get returned in CampaignService.get({'fields': ['Id', 'Name']})?

27 views
Skip to first unread message

Yang Gao

unread,
Mar 5, 2018, 4:19:02 AM3/5/18
to AdWords API Forum
Hi, I'm using the python lib and from some reason the CampaignService's get( ) returns all fields in the selector, as expected but also an extra field for Budget? Why is this an how can I just pull the campaign ID and Name?

Thanks!

Milind Sankeshware (AdWords API Team)

unread,
Mar 5, 2018, 3:53:11 PM3/5/18
to AdWords API Forum
Hi Yang,

To pull the campaign Id and name, you need to add these fields in selector. To achieve this please refer the python sample code here. When you select all fields in selector you will get budget stats as well. As Budget is part of campaign object. If you are facing an issue please share the complete SOAP request and response log.

Thanks,
Milind, AdWords API Team.

Yang Gao

unread,
Mar 6, 2018, 7:36:14 PM3/6/18
to AdWords API Forum
In the OP I've shown that I did select both Id and name in the selector, which I was able to get back. However, I was surprised to also get Budget even though I did NOT specific that in my selector. Are you saying that budget is just part of the campaign and it will always get returned whenever I call get on CampaignService, regardless of if I include it in the selector or not? If so, can you let me know how/where I can find this in the documentation? I.e. what are the implicit fields that come with every service?

Thx

Milind Sankeshware (AdWords API Team)

unread,
Mar 7, 2018, 11:01:54 AM3/7/18
to AdWords API Forum
Hi Yang,

If you have included all the fields in your selector, you may get the data corresponding to budget as well. Could you please share your SOAP request and response log for CampaignService.get( ), so that I can troubleshoot the issue?

Milind Sankeshware (AdWords API Team)

unread,
Mar 13, 2018, 2:57:43 PM3/13/18
to AdWords API Forum
Hi Yang,

The value is null, since the budget is not specified in selector. But some nodes might appear even when that is not specified in the selector. You could have a code logic to just look for the desired attributes from the response to avoid reading additional information. In the response, you could just look for the fields specified in your selector fields. Sample code is available in this section of the guide. 
Reply all
Reply to author
Forward
0 new messages