try to link a client account to my MCC account

97 views
Skip to first unread message

adma...@gmail.com

unread,
Sep 27, 2016, 10:37:42 PM9/27/16
to AdWords API Forum
Hello,
I have an mcc account with a basic access and a client account.
I would like to link the client account under the mcc account with the api for testing.

And I don't understand where I have to put all id accounts :
-which account number in clientCustomerId in my auth.ini file.
-which account number in $customer->clientCustomerId (ManagedCustomerLink()).
-which account number in $customer->managerCustomerId (ManagedCustomerLink()).

Any help is greatly appreciated.
have a good day.


Peter Oliquino

unread,
Sep 27, 2016, 11:14:54 PM9/27/16
to AdWords API Forum
Hi,

Please see below my answer to your questions :

-which account number in clientCustomerId in my auth.ini file.

For sending or extending invites, you will need to use the MCC account ID as the value of the clientCustomerId field in your auth.ini file.
For getting the invitations made by or to an account, you may use either the MCC account ID or your client account ID as the clientCustomerId in the auth.ini file.
For accepting invitations, you will then need to use the client account as your clientCustomerId in the auth.ini file.

-which account number in $customer->clientCustomerId (ManagedCustomerLink()).

For the clientCustomerId field in the code, you will need to use the client account ID.

-which account number in $customer->managerCustomerId (ManagedCustomerLink()).

For the managerCustomerId field in the code, you will need to use the MCC account ID.

I hope this had been helpful and please let us know if you have any further concerns.

Best regards,
Peter
AdWords API Team

adma...@gmail.com

unread,
Sep 30, 2016, 7:37:29 AM9/30/16
to AdWords API Forum
Hi Peter,

thank you for your answer, but when I follow your instruction your adword serveur answers me: "An error has occurred: [ManagedCustomerServiceError.BAD_ID @ operations[0]]".
maybe something is wrong with my code:

```<?php
 * @package    GoogleApiAdsAdWords
 * @subpackage v201605
 * @category   WebServices
 * @copyright  2016, Google Inc. All Rights Reserved.
 * @license    http://www.apache.org/licenses/LICENSE-2.0 Apache License,
 *             Version 2.0
 */

// Include the initialization file
require_once dirname(dirname(dirname(__FILE__))) . '/init.php';

/**
 * Runs the example.
 * @param AdWordsUser $user the user to run the example with
 */
function CreateAccountExample(AdWordsUser $user) {
  // Get the service, which loads the required classes.
  $managedCustomerService =
      $user->GetService('ManagedCustomerService', ADWORDS_VERSION);

  // Create customer.
  $customer = new ManagedCustomerLink();
 
  $customer->clientCustomerId = 'XXXXXXXXXX';
  $customer->linkStatus = 'ACTIVE';
  //$customer->currencyCode = 'EUR';
  //$customer->dateTimeZone = 'Europe/London';
  
  // Create operation.
  $operation = new LinkOperation();
  $operation->operator = 'ADD';
  $operation->operand = $customer;

  $operations = array($operation);

  // Make the mutate request.
  $result = $managedCustomerService->mutateLink($operation);

}
?>
 ```
Best regards
Pierre

Peter Oliquino

unread,
Oct 2, 2016, 10:03:34 PM10/2/16
to AdWords API Forum
Hi Pierre,

My apologies for the delay. Could you confirm if you have written the account IDs (clientCustomerId and managerCustomerId) without dashes (e.g correct -> XXXXXXXXXX, incorrect -> XXX-XXX-XXXX)?

adma...@gmail.com

unread,
Oct 4, 2016, 11:17:44 AM10/4/16
to AdWords API Forum

Hi peter,

thanks for your answer, but yes i have written the accounts IDs without dashes.
can you confirm that i have to use ManagedCustomerLink, LinkOperation and mutateLink ?

I don't understand why google answer me : "An error has occurred: [ManagedCustomerServiceError.BAD_ID @ operations[0]]"
Because I can link this two account manually but i can't with the api.

Best regards,
Pierre

Peter Oliquino

unread,
Oct 4, 2016, 10:23:34 PM10/4/16
to AdWords API Forum
Hi Pierre,

Yes, you will need to use the LinkOperation in order to set the status that you defined using the ManagedCustomerLink. You may refer to the links to the guide that I included in my previous reply on the actions to make and account IDs to use for each scenario :

For sending or extending invites, you will need to use the MCC account ID as the value of the clientCustomerId field in your auth.ini file.
For getting the invitations made by or to an account, you may use either the MCC account ID or your client account ID as the clientCustomerId in the auth.ini file.
For accepting invitations, you will then need to use the client account as your clientCustomerId in the auth.ini file.

If the issue persists, kindly provide any SOAP request and response using Reply privately to author so I can better investigate the issue.
Reply all
Reply to author
Forward
0 new messages