Posts under category google-ads-api

I'm obviously missing something really obvious. If I use the standard report I can analyse the data by gender very easily. If I download the data via the API I can't find a gender field at all. I have a LOT of tables, but no field named gender (or anything close) or a field that contains gender details.

What am I missing in my understanding?

We have an app with offline access_type token. Yesterday all queries were broken, because authorization failed

POST https://oauth2.googleapis.com/token 

resulted in a

400 Bad Request response: { "error": "invalid_grant", "error_description": "Bad Request" }).

We use SDK Google Ads API Client Library for PHP for any queries to API.

Code example:

// Generate a refreshable OAuth2 credential for authentication.         $oAuth2Credential = (new OAuth2TokenBuilder())->fromFile($filePathName)->build();         $loggerFactory    = new LoggerFactory();         $logger           = $loggerFactory->createLogger('TestChannel',             APPLICATION_DIRECTORY . ".log/google/adsapi.date("Y-m").".log",             'DEBUG');         // Construct a Google Ads client configured from a properties file and the         // OAuth2 credentials above.         $googleAdsClient = (new GoogleAdsClientBuilder())             ->fromFile(std::lpath($filePathName))             ->withOAuth2Credential($oAuth2Credential)             ->withLogger($logger)             ->build();         $query = "SELECT customer_client.status FROM customer_client";         $googleAdsServiceClient = $googleAdsClient->getGoogleAdsServiceClient();         $response               = $googleAdsServiceClient->search(             $customerId,             $query,             ['pageSize' => self::PAGE_SIZE]         );         return $response->getIterator()->current();

App is in production in google cloud console.

What have we already done:

  • changed password for account
  • reset secret and generate new refresh token

Create new app isn't good solution for us, because I think, we couldn't quickly increase limits to API (but in this moment we were forced to use an app with basic limits and quota)

Any idea how to solve this problem or how contact Google oAuth team with this question?

Related to https://groups.google.com/g/adwords-api/c/nvLa0xPkdUs/m/0P3LcxBgAQAJ

Update: I had found, that there is no link to my app in https://myaccount.google.com/permissions Anyone know, how to add this permissions again?

I am trying to add users to the newly created audience in Google ads API but I am getting the following response from the API. I want to understand what is possibly causing this error and how to fix this?

Set<String> userList;  //this contains Hashed data(email of user that I want to upload)   List<UserDataOperation> userDataOperations = new ArrayList<>(userList.size());    for (String user : userList) {     UserDataOperation userDataOperationEmail = UserDataOperation.newBuilder().setCreate(         UserData.newBuilder()             .addUserIdentifiers(UserIdentifier.newBuilder().setHashedEmail(user).build())             .build()).build();     userDataOperations.add(userDataOperationEmail);    } 

I am trying to use a service account to connect with the Google Ads API.

At the momet my code looks like this:

$oAuth2Credential = (new OAuth2TokenBuilder())         ->withJsonKeyFilePath(self::CREDENTIALS_FILE_PATH)         ->withScopes('https://www.googleapis.com/auth/adwords')         ->withImpersonatedEmail(IMPERSONATED_EMAIL)         ->build();     $googleAdsClient = (new GoogleAdsClientBuilder())         ->withOAuth2Credential($oAuth2Credential)         ->withDeveloperToken(DEVELOPER_TOKEN)         ->build();     $googleAdsServiceClient = $googleAdsClient->getGoogleAdsServiceClient();     $query = 'SELECT campaign.id, campaign.name FROM campaign ORDER BY campaign.id';     $stream =         $googleAdsServiceClient->searchStream(CUSTOMER_ID, $query); 

In Google cloud I have created a project and a service account. The account is the same I have access to at Google Ads. Also I have set the Domain-Wide Delegation at Google Workspace, with this same account. In my opinion I did everything right, but I am getting this error:

I hope there's someone who can help me out.

I tried a lot of ways to enable the Vignette ads on the Next JS site before I realized that there always was a block for them in the inspector, it just never change "display: none" to "display: block".

<ins class="adsbygoogle adsbygoogle-noablate" style="display: none !important; width: 100vw !important; height: 100vh !important; inset: 0px auto auto 0px !important; clear: none !important; float: none !important; margin: 0px !important; max-height: none !important; max-width: none !important; opacity: 1 !important; overflow: visible !important; padding: 0px !important; position: fixed !important; vertical-align: baseline !important; visibility: visible !important; z-index: 2147483647 !important; background: transparent !important;" data-adsbygoogle-status="done" aria-hidden="true" data-vignette-loaded="true" data-ad-status="filled"></ins> 

How i saw on other sites this ins appear and after some interaction with the site display automatically changed from none to block and Vignette Ads appear. If I manually change in the inspector display to block - Vignette will appear immediately, but automatically never.

Please can anyone know a possible solution?