Hide
AdWords scripts

MccApp

The root object of the MCC API. Exposes methods for fetching and selecting ManagedAccount.

Methods:

MemberTypeDescription
accountLabels MccApp.AccountLabelSelector Returns the selector of all account labels in the account.
accounts MccApp.ManagedAccountSelector Returns the selector of accounts managed by this MCC account.
createAccountLabel void Creates a new account label.
select void Selects a ManagedAccount as the next account on which to operate.

accountLabels()

Returns the selector of all account labels in the account.

Return values:

TypeDescription
MccApp.AccountLabelSelector The selector of all account labels in the account.

accounts()

Returns the selector of accounts managed by this MCC account.

MCC Accounts that manage other accounts (i.e. Client Managers) are not returned.

Return values:

TypeDescription
MccApp.ManagedAccountSelector The selector of accounts under this MCC.

createAccountLabel(name)

Creates a new account label.

Usage examples:

 MccApp.createAccountLabel("My Account Label");

Returns nothing.

Arguments:

NameTypeDescription
name String The name of the new account label. Label names are case sensitive and must be unique. Max length is 40 characters. Any leading or trailing white spaces will be trimmed.

select(account)

Selects a ManagedAccount as the next account on which to operate. This can be used to make changes to an account managed by this MCC.
  var mccAccount = AdWordsApp.currentAccount();
  var childAccounts = MccApp.accounts().withIds(['123-456-7890']).get();
  var childAccount = childAccounts.next();

  MccApp.select(childAccount);
  // Now in the child account.
  // Returns all the keywords in the account whose CustomerId is '123-456-7890'.
  var keywords = AdWordsApp.keywords().get();

  MccApp.select(mccAccount);
  // Now back in the mcc account.

Returns nothing.

Arguments:

NameTypeDescription
account MccApp.ManagedAccount The account in whose context the script will continue executing.