Posts under category Google

I use the Google AdWords API to collect information about the search volume for a specific keyword. But the data I get as a response doesn't match with the data from the keyword planner or other keyword tools. Here I check the search volume for the keyword "Hunde" in Berlin, Germany in german.

targeting_service = adwordsClient.GetService('TargetingIdeaService') selector = {'ideaType': 'KEYWORD', 'requestType' : 'STATS'} selector['requestedAttributeTypes'] = ['KEYWORD_TEXT', 'SEARCH_VOLUME', 'TARGETED_MONTHLY_SEARCHES'] offset = 0 selector['paging'] = {'startIndex' : str(offset), 'numberResults' : str(1)} selector['searchParameters'] = [{    'xsi_type': 'RelatedToQuerySearchParameter',    'queries': ["hunde"] }] selector['searchParameters'].append({    'xsi_type': 'LocationSearchParameter',    'locations': [{'id': '1003854'}] }) selector['searchParameters'].append({    'xsi_type': 'LanguageSearchParameter',    'languages': [{'id': '1001'}] }) page = targeting_service.get(selector) print(page) 

As a response I get:

{     'totalNumEntries': 1,     'entries': [         {             'data': [                 {                     'key': 'KEYWORD_TEXT',                     'value': {                         'Attribute.Type': 'StringAttribute',                         'value': 'hunde'                     }                 },                 {                     'key': 'TARGETED_MONTHLY_SEARCHES',                     'value': {                         'Attribute.Type': 'MonthlySearchVolumeAttribute',                         'value': [                             {                                 'year': 2020,                                 'month': 12,                                 'count': 4743382                             },                             {                                 'year': 2020,                                 'month': 11,                                 'count': 455583                             },                             {                                 'year': 2020,                                 'month': 10,                                 'count': 8797951                             },                             {                                 'year': 2020,                                 'month': 9,                                 'count': 5218694                             },                             {                                 'year': 2020,                                 'month': 8,                                 'count': 5089585                             },                             {                                 'year': 2020,                                 'month': 7,                                 'count': 3149591                             },                             {                                 'year': 2020,                                 'month': 6,                                 'count': 3020638                             },                             {                                 'year': 2020,                                 'month': 5,                                 'count': 4928527                             },                             {                                 'year': 2020,                                 'month': 4,                                 'count': 754959                             },                             {                                 'year': 2020,                                 'month': 3,                                 'count': 5649676                             },                             {                                 'year': 2020,                                 'month': 2,                                 'count': 1590789                             },                             {                                 'year': 2020,                                 'month': 1,                                 'count': 2506674                             }                         ]                     }                 },                 {                     'key': 'SEARCH_VOLUME',                     'value': {                         'Attribute.Type': 'LongAttribute',                         'value': 3825504                     }                 }             ]         }     ] } 

But this data doesn't match with the data from the keyword planer.
Avg. monthly searches (Keyword planner): 10K – 100K

Does somebody knows why the data I'm receiving is wrong?

I have this following code to fetch all list of ads clients comes under a Ads manager account, I am using manager credentials to get list of clients.

public Customer[] GetAllManagerClientsList(string currentUserEmail, string authorizationCode)     {         string baseURL = _configuration.GetValue<string>("URL:SiteURL");         var currentUser = _userRepository.GetIntegratedAppsDetailByEmail(currentUserEmail);         AdsOAuthProviderForApplications oAuth2Provider = (user.OAuthProvider as AdsOAuthProviderForApplications);         oAuth2Provider.Config.OAuth2RedirectUri = baseURL + "/google-auth-callback";         oAuth2Provider.FetchAccessAndRefreshTokens(authorizationCode);         //Get customerID         user.Config.OAuth2AccessToken = oAuth2Provider.Config.OAuth2AccessToken;         user.Config.OAuth2RefreshToken = oAuth2Provider.Config.OAuth2RefreshToken;         CustomerService customerService = (CustomerService)user.GetService(AdWordsService.v201809.CustomerService);         var customersList = customerService.getCustomers();         var ClientCustomers = customersList != null && customersList.Length > 0 ? customersList.Where(c => c.canManageClients == false).ToList() : null;         if (ClientCustomers.Count() > 0)         {             return ClientCustomers.ToArray();         }         else         {             return null;         }     } 

I use “google-ads-api” to manage google ads. And api needs “customer_account_id” to initialization. However, I Couldn’t found how to get “customer_account_id” programmatically from user.

I used “react-google-login” in front-end, but there is no “customer_account_id” in the response. What is the best way to get customer_account_id?

Im building an app with google ads api using a service account auth flow (server to server).

The problem: the auth part is not working... I keep getting a 401 error.

Sample of the request:

const request = require('request'); .... request({   'method': 'GET',   'url': 'https://googleads.googleapis.com/v6/customers/XXXXXXXX',   'headers': {     'Authorization': 'Bearer XXXXXXXX',     'developer-token': 'XXXXXXXX',     'Content-Type': 'application/json'   } }) ... 

or

curl --location --request GET 'https://googleads.googleapis.com/v6/customers/XXXXXXXX' \ --header 'Authorization: Bearer XXXXXXXX' \ --header 'developer-token: XXXXXXXX' \ --header 'Content-Type: application/json' 

[ERROR] Response from google ads api:

{         "code": 401,         "message": "Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",         "status": "UNAUTHENTICATED"     } 

I cant seem to find out why Im getting this authentication error.

What I have tried:

  1. Following this guide step by step -> https://developers.google.com/google-ads/api/docs/oauth/service-accounts
  2. Using the python library -> https://github.com/googleads/googleads-python-lib
  3. Using the google ads API with REST (no library)
  4. On localhost server
  5. On the production server (the www.g-suite.com domain linked to the account)

Whatever method or environment I try, it results in the same error.

Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential 

Steps I have implemented:

  • Created a google ads manager account
  • Generated a valid developer token for that account
  • Created project in Google cloud platform
  • Opened a service account inside the project
  • Created a private key for the service account
  • Granting impersonation abilities in the G Suite domain for this scope: https://www.googleapis.com/auth/adwords
  • Enabled domain-wide delegation on the service account
  • Generated the access token with the key json file.

Generating the access token:

const { google } = require('googleapis'); const getAccessToken = async () => {     const SCOPES = ['https://www.googleapis.com/auth/adwords'];     const authClient = new google.auth.GoogleAuth({         keyFile: './pathtokeyfile.json',         scopes: SCOPES,     });     const token = await authClient.getAccessToken();     return token; }; 

I am surely missing something, but am not sure what it is..

Will be super grateful if someone can share a solution!! thanks champs 👍

The application worked fine for half a year, I tried to upload an update, everything was as usual, but the console received "We have determined your app contains code to facilitate Ad Fraud", although I almost did not change anything. The only change that had at least some relation to the advertisement, after the splash, an advertisement appears, after it is closed, it shows the main screen of the application, it was decided to extend the display time of the splash screen, so a slight delay was added so that the advertisement had a little more time to load. After that, the update failed. We wrote in support, after almost 2 weeks, they replied:

"I’ve reviewed your appeal request and found that your app still violates Google Play Policy. I’ve included details below about the specific issue with your app and what you can do to get your app back on Google Play.

Step 1: Fix the policy violation with your app

During review, we found that your app violates the Ad fraud policy:

Your app is not compliant with the Ad Fraud policy. Ad fraud is strictly prohibited. Ad interactions generated for the purpose of tricking an ad network into believing traffic is from authentic user interest is ad fraud, which is a form of invalid traffic.

Ads should not be shown in a way that results in inadvertent clicks. Forcing a user to click an ad or submit personal information for advertising purposes before they can fully use an app is prohibited. Ads should not appear after the user has exited the app, or after the user has pressed the back button to exit the app. Ads associated with your app must not interfere with other apps, ads, or the operation of the device, including system or device buttons and ports.

This includes overlays, companion functionality, and widgetized ad units. Ads must only be displayed within the app serving them. You can refer the attached screenshot for additional information.

You can read through the Ad Fraud policy page for more details and examples of common violations.

Please update your app to fix this issue. You may also want to double check that your app complies with all other Developer Program Policies, as additional enforcement could occur if there are further policy violations.

Step 2: Submit an update to your app

To submit an updated app bundle or APK:

Prepare your updates. Create a new release using the compliant app bundle or APK. Be sure to create the new release on the same track(s) as the non-compliant app bundle or APK, increment the version number, and set the release to 100% rollout. Follow the on-screen instructions to add APKs or app bundles, then review and roll out your release. Please let me know if you have any other questions. Thanks for working with us to fix the policy issue and for your continued support of Google Play."

It seems like the application does not break anything, but I came across this answer Uncaught exception thrown by finalizer: All WebView methods must be called on the same thread. (Expected Looper ) th / 57308639 # 57308639 it is possible if the application is minimized and the advertisement is loaded and is shown not in the application. Or, due to problems with the connection, it does not show ads immediately after the splash, but passes it to the main screen and then it already shows that it also seems to be wrong, but then problems with the update appeared earlier. Could any of this be a problem? What else could be the problem? Maybe someone did something similar, please tell me what are the solutions?