googleads.errors.AdWordsReportBadRequestError: Type: AuthenticationError.CLIENT_CUSTOMER_ID_INVALID

1,321 views
Skip to first unread message

Monty808

unread,
Mar 22, 2014, 12:22:42 AM3/22/14
to adwor...@googlegroups.com
Hi,


Google documentation for working with MCC and clients is not very good.  I mean.....where do I put the client id?

I am using the python api.,,,ad wow...how do I specify a client id?  Google..please help.............

adwords_client = adwords.AdWordsClient.LoadFromStorage(path='/etc/googleads.yaml')
report_downloader = adwords_client.GetReportDownloader(version='v201402')
report_query = ('SELECT CampaignId, AdGroupId, Id, Criteria, CriteriaType, '
                  'Impressions, Clicks, Cost '
                  'FROM CRITERIA_PERFORMANCE_REPORT '
                  'WHERE Status IN [ACTIVE, PAUSED] '
                  'DURING LAST_7_DAYS')

with open('adwords_client', 'w') as output_file:
    report_downloader.DownloadReportWithAwql(report_query, 'CSV', output_file)

googleads.errors.AdWordsReportBadRequestError: Type: AuthenticationError.CLIENT_CUSTOMER_ID_INVALID


adwords:
  developer_token:test
  user_agent: test
  client_id: test
  refresh_token: test

Monty808

unread,
Mar 22, 2014, 1:02:21 AM3/22/14
to adwor...@googlegroups.com
Dear Google...please help!




I even tried the below but get an error. 

report = {
            'reportName': 'Last 7 days CRITERIA_PERFORMANCE_REPORT',
            'dateRangeType': 'LAST_7_DAYS',
            'reportType': 'CRITERIA_PERFORMANCE_REPORT',
            'downloadFormat': 'CSV',
            'clientCustomerId':"xxx-xxx-xxx",
            'selector': {
                'fields': ['CampaignId', 'AdGroupId', 'Id', 'CriteriaType',
                           'Criteria', 'Impressions', 'Clicks', 'Cost']
            },
            # Enable to get rows with zero impressions.
            'includeZeroImpressions': 'false'
        }


File "/usr/local/lib/python2.7/dist-packages/suds_jurko-0.6-py2.7.egg/suds/mx/core.py", line 71, in append
    if self.start(content):
  File "/usr/local/lib/python2.7/dist-packages/suds_jurko-0.6-py2.7.egg/suds/mx/literal.py", line 86, in start
    raise TypeNotFound(content.tag)
suds.TypeNotFound: Type not found: 'clientCustomerId'

Michael Cloonan (AdWords API Team)

unread,
Mar 24, 2014, 8:37:13 AM3/24/14
to adwor...@googlegroups.com
Hi!

You can set the client_customer_id for the Python library in the googleads.yaml file, which should go in your home directory. You'll notice this is included by default, but is commented out. Just un-comment it out and add your value and you should be good to go.

You can't set the Client Customer ID in the report request directly; it needs to be part of the SOAP headers which are defined differently. You can see an example of how to do this without the .yaml file in the create_adwords_client_without_yaml.py file.

Regards,
Mike, AdWords API Advisor

shivankit sharma

unread,
Oct 23, 2018, 7:05:22 PM10/23/18
to AdWords API and Google Ads API Forum
Hi Michael,

The link on how to create Adwords client without yaml is broken. How can i do this today?
Reply all
Reply to author
Forward
0 new messages