Hi Luis,
For the shopping campaigns, since the bid modifier is based on product 
group, not keywords.
Could you please tell me what criteria type I can select?
The attachment is the code for the AdGroupCriterionService.get() 
<https://developers.google.com/adwords/api/docs/reference/v201806/AdGroupCriterionService#get>
  function.
Thank you so much,
Kara

On Tuesday, July 31, 2018 at 9:22:05 AM UTC-4, y...@globalindustrial.com 
wrote:
>
> Hi Luis,
> Thanks for the reply. It's very helpful!
> Kara
>
> On Monday, July 30, 2018 at 11:20:39 PM UTC-4, Luis Xander Talag (AdWords 
> API Team) wrote:
>>
>> Hi Kara,
>>
>> You could use the AdGroupCriterionService.get() 
>> <https://developers.google.com/adwords/api/docs/reference/v201806/AdGroupCriterionService#get>
>>  method 
>> to retrieve the id 
>> <https://developers.google.com/adwords/api/docs/reference/v201806/AdGroupCriterionService.Criterion#id>
>>  of 
>> criterion. You may check this sample code 
>> <https://developers.google.com/adwords/api/docs/samples/java/basic-operations#get-keywords-in-an-ad-group>
>>  in 
>> Java (also available in other languages) for your reference. In reports, 
>> you could get the criteriaId by searching the report field name in this 
>> link 
>> <https://developers.google.com/adwords/api/docs/appendix/reports/all-reports>.
>>  
>> Also, you could check this guide 
>> <https://developers.google.com/adwords/api/docs/appendix/codes-formats> for 
>> table of criterion IDs.
>>
>> Feel free to write back if you have further clarifications.
>>
>> Regards,
>> Luis
>> AdWords API Team
>>
>> On Monday, July 30, 2018 at 9:17:59 PM UTC+8, YLi wrote:
>>>
>>> Hi Luis,
>>> This is very great!
>>> Would you know where I can find the CRITERION_ID? I only see the ad 
>>> group ID in the shopping reports.
>>> Thanks,
>>> Kara
>>>
>>> On Monday, July 30, 2018 at 1:52:58 AM UTC-4, Luis Xander Talag (AdWords 
>>> API Team) wrote:
>>>>
>>>> Hi Kara,
>>>>
>>>> You may use the DataService.getAdGroupBidLandscape() 
>>>> <https://developers.google.com/adwords/api/docs/reference/v201806/DataService#getadgroupbidlandscape>
>>>>  method 
>>>> to fetch the bid landscapes for your ad group. You may refer to this 
>>>> guide 
>>>> <https://developers.google.com/adwords/api/docs/guides/bid-landscapes#fetching_bid_landscapes_for_criteria_and_ad_groups>
>>>>  for 
>>>> more information and you may also look to this complete sample code 
>>>> <https://developers.google.com/adwords/api/docs/samples/java/optimization#get-a-bid-landscape-for-an-ad-group-and-criterion>
>>>>  in 
>>>> Java (also available in other languages) for your reference. However, 
>>>> since 
>>>> the API doesn't have a feature on exporting data from the service call 
>>>> into 
>>>> a spreadsheet, you should create a method on your end to do this.
>>>>
>>>> Let me know if you have further clarifications.
>>>>
>>>> Thanks and regards,
>>>> Luis
>>>> AdWords API Team 
>>>>
>>>> On Monday, July 30, 2018 at 9:52:36 AM UTC+8, YLi wrote:
>>>>>
>>>>> Hi,
>>>>> Is there any one can help me on exporting the data with the Bid 
>>>>> Landscape API?
>>>>> I want to call the bid and impression estimation for each adgroup in a 
>>>>> campaign, then export the data into a google sheet.
>>>>> Would I be able to do so? Can someone help me at the script level?
>>>>> Thank you so much,
>>>>> Kara
>>>>>
>>>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@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 the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@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/758a7963-d358-4209-8069-a071b9d82cac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
def getcriterion(client, adgroup_id):
  # Initialize appropriate service.
  ad_group_criterion_service = client.GetService(
      'AdGroupCriterionService', version='v201806')
   # Construct selector and get all ad group criteria.
  offset = 0
  selector = {
      'fields': ['Id', 'CriteriaType', 'PartitionType', 'CaseValue'],
      'predicates': [
          {
              'field': 'AdGroupId',
              'operator': 'EQUALS',
              'values': [adgroup_id]
          },
          {
              'field': 'CriteriaType',
              'operator': 'EQUALS',
              'values': ['PRODUCT_PARTITION']
          }
      ],
      'paging': {
          'startIndex': str(offset),
          'numberResults': str(PAGE_SIZE)
      }
  }
  more_pages = True
  while more_pages:
    page = ad_group_criterion_service.get(selector)
        
    # Display results.
    if 'entries' in page:
      for productgroup in page['entries']:
        print ('productgroup ID "%s", type "%s", partitiontype "%s", and 
casevalue '
               '"%s" was found.' % (
                   productgroup['criterion']['id'],
                   productgroup['criterion']['CriteriaType'],
                   productgroup['criterion']['PartitionType'],
                   productgroup['criterion']['CaseValue']))
    else:
      print ('No keywords were found.')
    offset += PAGE_SIZE
    selector['paging']['startIndex'] = str(offset)
    more_pages = offset < int(page['totalNumEntries'])
  • ... YLi
    • ... 'Luis Xander Talag (AdWords API Team)' via AdWords API and Google Ads API Forum
      • ... YLi
        • ... 'Luis Xander Talag (AdWords API Team)' via AdWords API and Google Ads API Forum
          • ... YLi
            • ... YLi
              • ... 'Luis Xander Talag (AdWords API Team)' via AdWords API and Google Ads API Forum

Reply via email to