How to pull individual reports for each account within an MCC

255 views
Skip to first unread message

Stephen

unread,
Dec 4, 2014, 10:29:04 AM12/4/14
to adwor...@googlegroups.com
Hi I'm new to the Adwords API. Using Python library to pull Keywords performance report.

Works fine when my client_customer_id in YAML file is set to an account id but when I set it to an MCC client id it throws this error:

googleads.errors.AdWordsReportBadRequestError: Type: ReportDefinitionError.CUSTOMER_SERVING_TYPE_REPORT_MISMATCH
Trigger: None
Field Path: selector

So I understand that I have to inform it that it is an MCC id and to extract the child Id's within and iterate through them I just don't know how to do that :(

I can't seem to find a clear example online of this. Can anyone help?

Thanks


MVF Global is a trading name of Marketing VF Limited (MVF), a company registered in England and Wales with company number 06951544, whose registered office address is at Ryland House, 24A Ryland Road, London NW5 3EH, United Kingdom. VAT number: GB 976 7819 46.
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of MVF unless specifically stated. If you have received it in error, please delete it from your system. Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately. Please note that MVF monitors e-mails sent or received. Further communication will signify your consent to this.

Josh Radcliff (AdWords API Team)

unread,
Dec 4, 2014, 4:24:40 PM12/4/14
to adwor...@googlegroups.com
Hi,

To get the list of accounts under the MCC, see the get_account_hierarchy.py example. Once you have that list, between each reporting request you can update the customer ID of your AdWordsClient using the mechanism described here.

Cheers,
Josh, AdWords API Team

Stephen

unread,
Dec 5, 2014, 9:05:34 AM12/5/14
to adwor...@googlegroups.com
Hi thanks Josh. Grabbing the account Id's is fine but setting customer ID with:
adwords_client = AdWordsClient.LoadFromStorage()
adwords_client.SetClientCustomerId('my_client_customer_id')
Is returning the error:

AttributeError: 'AdWordsClient' object has no attribute 'SetClientCustomerId'

Do you understand what I'm doing wrong?

Thanks,

Stephen





Stephen

unread,
Dec 8, 2014, 12:24:05 PM12/8/14
to adwor...@googlegroups.com
Issue solved. In case anyone has this problem do the following:

adwords_client.client_customer_id = 'my_client_customer_id'

where 'my_client_customer_id' is a string of your client customer id.

Thanks
Reply all
Reply to author
Forward
0 new messages