Hi,

I'm using the Google Ads API with the Interactive Query Builder along with 
the google-ads-python Github to search for specific data values. I'm 
getting about half the data I'm looking for despite using queries provided 
by the Query Builder .. the queries work for some data values, but not all. 
Any insight into how to search for the missing data would be much 
appreciated.

*Bid Strategy Type* - this field is also not returned when searching 'FROM 
campaign'

queryStrat = ( 'SELECT bidding_strategy.type, bidding_strategy.name '
'FROM bidding_strategy '
'LIMIT 20')


Terminal Output:
Dylan-McBurnetts-MacBook-Pro:basic_operations dylanmcburnett$ 
./get_dylan_data.py -c 4461958680
<google.api_core.page_iterator.GRPCIterator object at 0x110ebc310>
hello
No handlers could be found for logger "google.ads.google_ads.client"
Why are you so wrong?
Request with ID "DHHKl7dGZ-ACUPdvZPrE5g" failed with status 
"INVALID_ARGUMENT" and includes the following errors:
        Error with message "Error in SELECT clause: invalid field name 
'FROM'.".

Code being executed:

from __future__ import absolute_import

import argparse
import six
import sys

import google.ads.google_ads.client


_DEFAULT_PAGE_SIZE = 1000


def main(client, customer_id, page_size):
ga_service = client.get_service('GoogleAdsService', version='v2')

queryStrat = ( 'SELECT bidding_strategy.type, bidding_strategy.name, '
'FROM bidding_strategy '
'LIMIT 20')

results = ga_service.search(customer_id, query=queryStrat, page_size
=page_size)
print str(results)
print 'hello'

try:
for row in results:
print '******** ROW DATA'
print str(row)
print('Campaign with ID %d and name/Priority "%s" was found.'
% (row.campaign.id.value, row.campaign.shopping_setting.campaign_priority))
# % (row.campaign.id.value, row.campaign.name.value))
except google.ads.google_ads.errors.GoogleAdsException as ex:
print 'Why are you so wrong?'
print('Request with ID "%s" failed with status "%s" and includes the '
'following errors:' % (ex.request_id, ex.error.code().name))
for error in ex.failure.errors:
print('\tError with message "%s".' % error.message)
if error.location:
for field_path_element in error.location.field_path_elements:
print('\t\tOn field: %s' % field_path_element.field_name)
sys.exit(1)


if __name__ == '__main__':
# GoogleAdsClient will read the google-ads.yaml configuration file in the
# home directory if none is specified.
google_ads_client = (google.ads.google_ads.client.GoogleAdsClient
.load_from_storage())
parser = argparse.ArgumentParser(
description='Lists all campaigns for specified customer.')
# The following argument(s) should be provided to run the example.
parser.add_argument('-c', '--customer_id', type=six.text_type,
required=True, help='The Google Ads customer ID.')
args = parser.parse_args()

main(google_ads_client, args.customer_id, _DEFAULT_PAGE_SIZE)


Running a similar query below fails to return any data for:
- bidding_strategy.type
- language_code
- url_custom_parameters
query2 = ( 'SELECT campaign.id, campaign.name, '
'segments.ad_network_type, segments.device, '
'bidding_strategy.type, campaign.dynamic_search_ads_setting.language_code, '
'campaign.shopping_setting.campaign_priority, '
'campaign_budget.type, campaign.url_custom_parameters '
'FROM campaign '
'LIMIT 20')


Other values that I am unable to query:
- 'keyword_plan_negative_keyword'
- 'campaign_criterion.bid_modifier'

Values I have successfully queried:
- campaign.name
- campaign.id
- segments.ad_network_type
- 'campaign_budget.delivery_method'
- 'segments.device from campaign'
- 'conversion_action.attribution_model_settings.attribution_model'

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/416e044b-c118-4d0f-8e67-b1e4c1a3bc48%40googlegroups.com.

Reply via email to