Google Ads API get accounts under an MCC

72 views
Skip to first unread message

beyond Clicks

unread,
Jul 20, 2020, 6:00:07 AM7/20/20
to AdWords API and Google Ads API Forum
Hi Guys, I'm running the below query;

SELECT
customer
.id, customer_client.id, customer_client.descriptive_name
FROM
customer_client


which is then run through  like so;

$stream = $googleAdsServiceClient->searchStream($customerId$mccQuery);

the goal being to give the system an account number of an MCC "$customerId" and have it run through the above query ($mccQuery) to get a list of the account numbers of all the accounts Under that specific MCC's control, which will then be sent off to a different query.

My issue is I cannot find what functions to call in my iterator to pull the specific value out of the response.

Google Ads API Forum Advisor Prod

unread,
Jul 20, 2020, 1:56:14 PM7/20/20
to byon...@gmail.com, adwor...@googlegroups.com

Hi,

Thank you for reaching out. As you can see here, the elements from the response are pulled out by calling the iterateAllElements() method. Then you could select the specific field you need for other queries.


Thanks and regards,
Xiaoming, Google Ads API Team



 

ref:_00D1U1174p._5004Q22XTD1:ref

beyond Clicks

unread,
Jul 21, 2020, 3:36:54 AM7/21/20
to AdWords API and Google Ads API Forum
Hi Xiaoming, Is there a document anywhere where all these "get" fields are listed? such as ->getIdUnwrapped()?

Rather than having to look through the examples it'd be much easier to have documentation to reference.

Google Ads API Forum Advisor Prod

unread,
Jul 21, 2020, 11:25:44 AM7/21/20
to byon...@gmail.com, adwor...@googlegroups.com

Hi ,

Thank you for reaching out. You could go to the specific resource and check the available functions. For example, if you would like to fetch the Unwrapped Id of an ad group, you could locate the AdGroup resource and then use the getIdUnwrapped() function. You could find the list of the resources here. Another approach is in your IDE, you could add an “->” after $googleAdsRow and as a result of the autocomplete, you would see all the available functions under the object.




Thanks and regards,
Xiaoming, Google Ads API Team



 

ref:_00D1U1174p._5004Q22XTD1:ref
Reply all
Reply to author
Forward
0 new messages