how can i get customer client id which is linked my MCC account using adwords api ????

973 views
Skip to first unread message

v

unread,
Aug 19, 2017, 5:40:12 AM8/19/17
to AdWords API Forum

Hi, 

          I have standard access but, I can't get AdWords report data using my MCC account customer_idso, how I can get customer client report using its customer_id AdWords API


          when I use my MCC account customer_id I can't get data. and when I use another production account customer_id gives same data for all customer.

 

          I need different report for different customer client_id.  I want to create report same as report garden.

Thanks

Peter Oliquino

unread,
Aug 20, 2017, 11:44:07 PM8/20/17
to AdWords API Forum
Hi,

If you wish to retrieve the list of customers linked to your MCC, then you may use the ManagedCustomerService.get and refer to the GetAccountHierarchy example (other supported languages are also available in the link).

As for generating all of your accounts' reports using your MCC, you may refer to the Parallel Report Download example. Let me know if this helps.

Best regards,
Peter
AdWords API Team
Message has been deleted

v

unread,
Aug 29, 2017, 3:22:54 AM8/29/17
to AdWords API Forum
hi 

                   Thnks for your reply  but using ManagedCustomerService.get and Account Management I create new account under manager account, but still I getting error [AuthorizationError.USER_PERMISSION_DENIED @ ; trigger:'<null>'] 

I need to get customer id which I want to log in for getting those account report.

in this below code if I have use withClientCustomerId('xxx-xxx-xxx') in session then its give error  [AuthenticationError.CLIENT_CUSTOMER_ID_IS_REQUIRED @ ; trigger:'<null>'].

My code is below :

 $session = (new AdWordsSessionBuilder())
            ->fromFile(base_path() . '/adsapi_php.ini')
            ->withClientCustomerId('xxx-xxx-xxx') // this is my manager account id
            ->withOAuth2Credential($oauth2)
            ->build();

$customer = new ManagedCustomer();
                $customer->setName('Account #' . uniqid());
                $customer->setCurrencyCode('USD');
                $customer->setDateTimeZone('Europe/London');

                $operations = [];
                $operation = new ManagedCustomerOperation();
                $operation->setOperator(Operator::ADD);
                $operation->setOperand($customer);
                $operations[] = $operation;

                $adWordsServices = new AdWordsServices();
                
                $managedCustomerService =
                $adWordsServices->get($session, ManagedCustomerService::class);

                $customer = $managedCustomerService->mutate($operations)->getRval()[0];

                $cust_id = $customer->getCustomerId();
                $user->client_customer_id=$cust_id; // i need this id

Peter Oliquino

unread,
Aug 29, 2017, 4:12:24 AM8/29/17
to AdWords API Forum
Hi,

The USER_PERMISSION_DENIED error you are encountering is due to the client account ID not being linked to your MCC, or the OAuth2 credentials you are using does not have access to the clientCustomerId you have specified. This said, you can make sure that the client account you are using as the clientCustomerId is linked to the MCC that is associated to your developer token. Another solution is to generate OAuth2 credentials using an email address associated to the clientCustomerId you have specified or wish to use.

To do this, you will need to use the ManagedCustomerService and the GetAccountHierarchy sample code, and specify the MCC account ID as the value for your clientCustomerId in the properties file to give you the list of all client accounts linked to your MCC that you can use.

As for the CLIENT_CUSTOMER_ID_IS_REQUIRED error, you will need to specify a value in your clientCustomerId (in this format "123-456-7890") properties file to avoid this error. Let me know if this helps.

Thanks and regards,
Peter
AdWords API Team

v

unread,
Aug 29, 2017, 4:33:10 AM8/29/17
to AdWords API Forum
Hi, 
      Thnks, I know this all thing but I need to link third party user(Which is not linked) account to My MCC account using AdWords API, so which API I used ??

I want to get report same as like  https://reportgarden.comIn my system, I want to the same process like  https://reportgarden.com for third party user which is not linked my MCC Account.

Peter Oliquino

unread,
Aug 29, 2017, 5:29:53 AM8/29/17
to AdWords API Forum
Hi,

My apologies as our team does not support integrations of third party accounts and we can only provide support or assistance for AdWords API specific issues.

Best regards,
Peter
AdWords API Team

v

unread,
Aug 29, 2017, 6:02:50 AM8/29/17
to AdWords API Forum
Hi,

     How does https://reportgarden.com work? Can I create the same system as  https://reportgarden.com ??  and Any additional Permission required from google for that ??

Thanks

Peter Oliquino

unread,
Aug 29, 2017, 6:12:53 AM8/29/17
to AdWords API Forum
Hi,

As mentioned in my previous reply, any topics related to reportgarden or any third parties are already out of scope for our team. Our team can only provide support for AdWords API related issues and we cannot comment further regarding any implementation concerning third parties. You may want to contact the reportgarden support team as they may be able to provide better assistance.

MWA

unread,
Oct 13, 2017, 9:15:52 AM10/13/17
to AdWords API Forum
Hi n,

When getting account under your manager accounts you don't need to add

            ->withClientCustomerId('xxx-xxx-xxx') // this is my manager account id

Try without it. use this function only when you want to access your customers data. currently you want to access your data, that's why it's not working.
Reply all
Reply to author
Forward
0 new messages