API AdWords v201802

65 views
Skip to first unread message

myrabot...@gmail.com

unread,
Mar 12, 2018, 7:41:40 AM3/12/18
to AdWords API Forum
Здравствуйте! 
Подскажите пожалуйста, в старой версии php библиотеки была возможность использовать код :
$user = new AdWordsUser();
$user->SetClientCustomerId('123-123-1234'); 

Есть-ли такая возможность в библиотеке v201802 для нескольких аккаунтов? 

Dhanya Sundararaju (AdWords API Team)

unread,
Mar 12, 2018, 12:05:14 PM3/12/18
to AdWords API Forum
Hi,

You will be able to set the client customer id via the AdWordsSessionBuilder.php as per the New ads PHP client library upgrade guide. Please note that you will be able to set to only 1 client customer id. However, if your requirement is to get all the accounts under a MCC, you can set the clientcustomerid to a MCC id, and then use ManagedCustomerService->get to pull up all accounts under it. Else, if your requirement is to get details of all the customers directly accessible by the user authenticating the call you can use CustomerService->getcustomers. Please let me know if you have further questions.

Regards,
Dhanya, AdWords API Team

myrabot...@gmail.com

unread,
Mar 13, 2018, 3:17:59 AM3/13/18
to AdWords API Forum
Спасибо за ответ!
Я не совсем понял.В цикле по каждому clientCustomerId нельзя получать список его кампаний ? необходимо только указывать в файле adsapi_php.ini ?
Спасибо!

понедельник, 12 марта 2018 г., 20:05:14 UTC+4 пользователь Dhanya Sundararaju (AdWords API Team) написал:

Dhanya Sundararaju (AdWords API Team)

unread,
Mar 13, 2018, 2:53:03 PM3/13/18
to AdWords API Forum
Hi,

You can either specify in the adsapi_php.ini file or via by using the AdWordsSessionBuilder as below:

$session = (new AdWordsSessionBuilder())
->fromFile()
->withOAuth2Credential($oAuth2Credential)
->withclientcustomerid("XXX-XXX-XXXX")
->build();

Once you get the client customer id via ManagedCustomerService->get, you can pull up campaigns for each client customer id by using the CampaignService. Please check this section of guide for code samples.
Reply all
Reply to author
Forward
0 new messages