Reputation: 78402
I am using the python adwords api v201402.
I have an mcc account.
report_downloader = self.client.GetReportDownloader(version='v201402')
# Create report definition.
report = {
'reportName': 'Last 7 days CRITERIA_PERFORMANCE_REPORT',
'dateRangeType': 'LAST_7_DAYS',
'reportType': 'CRITERIA_PERFORMANCE_REPORT',
'downloadFormat': 'CSV',
'selector': {
'fields': ['CampaignId', 'AdGroupId', 'Id', 'CriteriaType',
'Criteria', 'Impressions', 'Clicks', 'Cost']
},
# Enable to get rows with zero impressions.
'includeZeroImpressions': 'false'
}
If I dont add a customer ID I get the below error:
output, return_money_in_micros)
File "/usr/local/lib/python2.7/dist-packages/googleads-1.0.1-py2.7.egg/googleads/adwords.py", line 406, in _DownloadReport
raise self._ExtractError(e)
googleads.errors.AdWordsReportBadRequestError: Type: AuthenticationError.CLIENT_CUSTOMER_ID_INVALID
Trigger: <null>
Field Path: None
How do I add a customer id? I tried adding 'clientCustomerId':"xxx-xxx-xxx" in the hash but I get the below:
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'
Upvotes: 0
Views: 1711
Reputation: 176
This is a bit late, but hopefully this might help others stumbling onto this question.
If you have multiple clients for whom you need to explicitly set the clientCustomerId outside of your yaml, in the instance where you have one MCC but multiple clients, you can do the following:
self.client = AdWordsClient.LoadFromStorage()
self.client.SetClientCustomerId(<client_customer_id>)
After that, you can use the report downloader as needed, and you can re-assign the customer ID as needed.
Upvotes: 2
Reputation: 536
Make sure your Googleads.yaml file is configured correctly and in your home directory. I got a similar error and that fixed it.
Upvotes: 0
Reputation: 425
The clientCustomerId
is set within your API client object.
Depending on your goals, you should either set this value in a config file, or in your client
method.
Upvotes: 1