Get readout from AdGroupCriterionService selector

56 views
Skip to first unread message

Stella

unread,
Jan 14, 2019, 3:38:32 PM1/14/19
to AdWords API and Google Ads API Forum
Hi,  I am using 201809 version of adwords. trying to first get and then modify bidding at adgroup level. 
My CAMPAIGN_ID=1647087544 is one with tcpa set with biddingStrategySource=CAMPAIGN level. I believe in that way I can see the bidsCPA value. however, the ‘bids’ field is returned as empty. I get returns like this

Your doc, does not tell me how to access to “bids” field, can you tell me specificlly how based on below code?

Thank you
def main(client, campaign_id):
  # Initialize appropriate service.
  ad_group_service = client.GetService('AdGroupCriterionService', version='v201809')
offset = 0
# Construct selector and get all ad groups.
selector = {
'fields': [
'AdGroupId','BaseCampaignId','QualityScore'
,'BiddingStrategyId','BiddingStrategyName','BiddingStrategySource','BiddingStrategyType'
],
'predicates': [
{
'field': 'CampaignId',
'operator': 'EQUALS',
'values': [campaign_id]
}
],
'paging': {
'startIndex': str(offset),
'numberResults': str(PAGE_SIZE)
}
}

more_pages = True
while more_pages:
page = ad_group_service.get(selector)

# Display results.
if 'entries' in page:
for ad_group in page['entries']:
print(ad_group)
else:
print ('No ad groups were found.')
offset += PAGE_SIZE

selector['paging']['startIndex'] = str(offset)
more_pages = offset < int(page['totalNumEntries'])

if __name__ == '__main__':
# Initialize client object.
adwords_client = adwords.AdWordsClient.LoadFromStorage()
main(adwords_client, CAMPAIGN_ID)

Yang Yang

unread,
Jan 14, 2019, 4:34:37 PM1/14/19
to AdWords API and Google Ads API Forum
Ops, I forget to attach how output looks like.
Also need to ask, this trial campaign is set with campaign tcpa why the biddingStrategyId and biddingStrategyName are both none?
image.png

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "AdWords API and Google Ads API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/uzsF0_nV1IE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/528ff8f4-d455-4259-985d-cf33ee38f0dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bharani Cherukuri (AdWords API Team)

unread,
Jan 14, 2019, 5:56:55 PM1/14/19
to AdWords API and Google Ads API Forum
Hello, 

The bids can be set at the adgroup level or the adgroup criterion levels. If you're setting the bids at the AdGroup level, you may use the AdGroupService.mutate() operation by selecting the BiddingStrategyConfiguration to set the bid. Please check this code sample as a reference. If you're setting the bids at the AdGroup criterion level, you may use the AdGroupCriterionService.mutate() operation. The BiddingStrategyId and BiddingStrategyName are fields available for Shared bidding strategies. Since you're using Target CPA, you will not have values for these fields. Also, I was able to check the keywords in this campaign and see that there is no bid value set which explains why you're seeing no bid values. You may refer to this code sample as a reference. Code samples in other languages can be found here. You may also refer to this guide on how to override strategy settings.

Let me know if you have any further questions. 

Regards,
Bharani, AdWords API Team

googleadsapi...@google.com

unread,
Jan 15, 2019, 2:14:59 PM1/15/19
to yangya...@gmail.com, AdWords API and Google Ads API Forum
Hello Yang, 

You will be able to get the Bid values using AdGroupCriterionService.get() and pull the CpcBid and CpmBid fields. For example, I was able to check the Keyword criteria in this account and see that there is no bid value set which explains why you're seeing no bid values. 

Let me know if you have any further questions. 

Regards,
Bharani, AdWords API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Yang Yang

unread,
Jan 15, 2019, 3:11:08 PM1/15/19
to googleadsapi...@google.com, AdWords API and Google Ads API Forum
Thanks Bharani for checking the criteria. There is not yet setting at criteria level. This is the next step I am moving forward with, so want to make sure I am understanding the service ahead of time.  Can I actually set and query tcpa at adgroup criterion level?
image.png

googleadsapi...@google.com

unread,
Jan 16, 2019, 10:31:32 AM1/16/19
to AdWords API and Google Ads API Forum
Hello Yang, 

The Target CPA bidding strategy sets the bids and help you get maximum conversions at the target cost-per-acquisition (CPA) you set. Target CPA bidding automatically finds an optimal CPC bid for your ad each time it's eligible to appear. For example, if you choose a target CPA of $10, Google Ads will automatically set your CPC bids to try to get you as many conversions at $10 on average. This will be set as the highest max. CPC bid that you want Google Ads to set for any keywords, ad groups or campaigns using Target CPA bidding. You will need to use the CpcBid to set/get the bid values for the criteria. You may refer to this help center article as a reference.

Let me know if you have any other questions. 

Regards,
Bharani, AdWords API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Reply all
Reply to author
Forward
0 new messages