python - How do I link accounts in the Google Adwords API using just a customer ID? -
i'm having hard time understanding google's api documentation , hoping here.
to me, extremely new developer, google api documentation makes no sense whatsoever.
i using google adwords python library, , code may useful: https://github.com/googleads/googleads-python-lib/blob/b80b8b3741a55f1d00c5974bc58f92540663c6f6/examples/adwords/v201603/account_management/create_account.py. however, need link existing account extending invitation , marking pending. i'm not trying create new account.
so begin writing in python? don't understand documentation , need create account based on given customer id. tips , tricks great!
to link existing account mcc account, need use managedcustomerservice
, mutatelink
method. in python, this:
# create service object managed_customer_service = client.getservice('managedcustomerservice', version='v201605') # construct operation, operator "add" , status "pending" results in new invitation operation = { 'operator': 'add', 'operand': { 'managercustomerid': your_mcc_account_id, 'clientcustomerid': account_id_to_be_invited, 'linkstatus': 'pending', 'pendingdescriptivename': 'some text helps identifying invitation', 'ishidden': false # can used hide account in mcc decrease clutter } } # send operation response = managed_customer_service.mutatelink([operation]) # print out resulting managedcustomerlink pprint.pprint(response.links[0])
note didn't test code, should give general idea on how works. see reference guide more details , how proceed once client account has accepted invitation.
Comments
Post a Comment