Googleads-php-lib: How do I switch to sub accounts?

22 views
Skip to first unread message

Rick Simnett

unread,
Jul 26, 2018, 5:55:58 AM7/26/18
to adwor...@googlegroups.com

Hello,
So I have been using the adwords api for awhile, and recently we have upgraded to the latest version of the library. Alot seems to have changed, but for the most part it was easy to adapt. We've run into one snag that we cant seem to figure out however. In the old version we could set the account we wished to work with, always a sub account of our MCC to make client level adjustments using the AdwordsUser class. It used to work like this:

 $user = new AdWordsUser();

$user->SetClientCustomerId('xxxxxxxxx');

...

But now we cant seem to figure out how to do it in the latest version.  Can someone provide us with the solution?

Thank you.

Bharani Cherukuri (AdWords API Team)

unread,
Jul 26, 2018, 3:19:52 PM7/26/18
to AdWords API and Google Ads API Forum
Hello Rick, 

The AdWordsUser class is deprecated and you will need to use the AdWordsSessionBuilder class to set the clientCustomerId. Please check the PHP upgrade guide for more information. 

Thanks,
Bharani, AdWords API Team
Reply all
Reply to author
Forward
0 new messages