Posts tagged with google-ads-api

I want to propose a budget for an ads account under my manager account. I have the following YAML file:

developer_token: 13245 login-customer-id: 1324567891 customer-id: 1324567891 user_agent:  13245 client_id: 13245 client_secret: 13245 refresh_token: 13245 

When i try to run my script, i get this error:

Error with message

"User doesn't have permission to access customer. Note: If you're accessing a client customer, the manager's customer id must be set in the 'login-customer-id' header.

This is the code that i use, from the example python library:

    try:     account_budget_proposal_response = (       account_budget_proposal_service.mutate_account_budget_proposal(           customer_id, account_budget_proposal_operation)) 

I am trying to fetch google Adwords reporting data (clicks,cost..etc) of specific addGroup with Google Ads Query Language buts saying CONTAINS ANY is not a valid operator to use with 'ad_group.name', here is my query

"query": "SELECT ad_group.name, metrics.impressions,metrics.clicks FROM ad_group where ad_group.name CONTAINS ANY ('pmp')" 

I need to fetch similar addgroup by name similar to SQL like '%%', there is a LIKE command in GAQL but its working like = , eg for add group = 'test-exam' this works

"query": "SELECT ad_group.name, metrics.impressions,metrics.clicks FROM ad_group where ad_group.name LIKE ('test-exam')" 

but this returns nothing

"query": "SELECT ad_group.name, metrics.impressions,metrics.clicks FROM ad_group where ad_group.name CONTAINS ANY ('test')" 

I've setup a Google BigQuery Transfer to transfer Google Ads (formerly AdWords) data. The transfer job is successful and shows no error.

Summary: succeeded 87 jobs, failed 0 jobs.

However, I went over to the Datasets and saw a lot of views and partitioned tables. But none has any data.

I've read through all the documentation on https://cloud.google.com/bigquery-transfer/docs/adwords-transfer#migrating_google_ads_data_to_mccs, but couldn't figure out where went wrong.

Anyone has similar issue?

I'm making a script buildt with code from the google ads api. In this script I'm trying to make a new account, and for that to happen, i need to select which manager account the script should be under. That is done with this code:

parser = argparse.ArgumentParser(description=('Creates a new client under the given manager.')) # The following argument(s) should be provided to run the example. parser.add_argument('-m', '--manager_customer_id', type=str,                     required=True, help='A Google Ads customer ID for the '                     'manager account under which the new customer will '                     'be created.') args = parser.parse_args() 

So when i run the script, i type in python new_acc.py xxx-xxx-xxxx and hit enter, and then i get the following error:

usage: new_acc.py [-h] -m MANAGER_CUSTOMER_ID new_acc.py: error: the following arguments are required: -m/--manager_customer_id 

I have also tried to add the manager_customer_id in the .yaml file.

I want to use the Google Ads API to access Google Ads reports. As a preliminary step, we want to use the GoogleCustomerServiceClient to retrieve customer information.

$MMC_ID = <My MMC 10 digits number>; $credentialsIniPath = app_path('resources/credentials/google/google_ads_php.ini'); $oAuth2Credential = (new OAuth2TokenBuilder())     ->fromFile($credentialsIniPath)     ->build(); $googleAdsClient = (new GoogleAdsClientBuilder())     ->fromFile($credentialsIniPath)     ->withOAuth2Credential($oAuth2Credential)     ->build(); $customerServiceClient = $googleAdsClient->getCustomerServiceClient(); try {     $customer = $customerServiceClient->getCustomer(ResourceNames::forCustomer($MMC_ID)); } catch(GoogleAdsException $e) {     $this->error($e->getMessage()); } 

But it returns an error

Fault ------- Status code: 7 Details: The caller does not have permission Failure: {"errors":[{"errorCode":{"authorizationError":"DEVELOPER_TOKEN_NOT_APPROVED"},"message":"The developer token is not approved. Non-approved developer tokens can only be used with test accounts."}]} 

The account Oauth2 login that created MMC, MMC is a test account. In google_ads_php.ini, clientId, clientSecret, refreshToken, and developerToken are already filled in. The refreshToken has just been generated.

What should I check for in this one?

Thanks.