I'm trying to create an AdGroupAd using an existing groupAd, and i'm getting a "segmentation fault" error message I've been at this for more than a day now, but the lack of details on the error just makes this insane to understand what's wrong

running on docker

Client library: v5.0.0

Google Ads API: v5.0

PHP 7.4.12 (cli) (built: Nov 5 2020 20:24:10) ( NTS )

Zend Engine v3.4.0,

ionCube PHP Loader + ionCube24 v10.4.4

Zend OPcache v7.4.12

protobuff 3.14.0

grpc 1.33.1

my code: Assume createAdGroupAd() is called with a valid resource name for an adGroup in the $adGroup parameter and the type is CreativeType_Asset::TYPE_YOUTUBE in this case (although i tried with both types and both give out the error)

public function createAdGroupAd($adGroup, $data){         $service = $this->client->getAdGroupAdServiceClient();         $ad = $this->createAd($data, $data['asset']->type);         $adGroupAd = new AdGroupAd([             'ad' => $ad,             'status' => AdGroupAdStatus::PAUSED,             'ad_group' =>  $adGroup         ]);         $adGroupAdOperation = new AdGroupAdOperation();         $adGroupAdOperation->setCreate($adGroupAd);         //this is the call causing the error         $response = $service->mutateAdGroupAds(             $this->customerId,             [$adGroupAdOperation]         );         return $response->getResults()->count() > 0 ? $response->getResults()[0]->getResourceName() : null;     }     public function createAd($data, $adType = null){         $service = $this->client->getAdServiceClient();         $appAdInfo = new AppAdInfo([             'headlines' => array_map(function ($headline) {                 new AdTextAsset(['text' => $headline]);             }, [$data['creative']->title1, $data['creative']->title2]),             'descriptions' => array_map(function ($description) {                 new AdTextAsset(['text' => $description]);             }, [$data['creative']->description1, $data['creative']->description2])         ]);         switch ($adType) {             case CreativeType_Asset::TYPE_IMAGE:                 $appAdInfo->setImages([new AdImageAsset(['asset' => $data['assetResourceName']])]);                 break;             case CreativeType_Asset::TYPE_YOUTUBE:                 $appAdInfo->setYoutubeVideos([new AdVideoAsset(['asset' => $data['assetResourceName']])]);                 break;             default:                 break;         }         return new Ad([             'app_ad' => $appAdInfo,             'type' => AdType::APP_AD]);     } 

I am trying to work with Google-ads-API. Running Ubuntu 20.04, Python 3.9(min requirement for the client library to work is 3.6), working with google-ads-api V6. Here's the story of my agony.

I have made a test manager account[A], generated a developer's token, and have "test-level" access to use the API, which is great. Test level allows you to make calls to the API regarding information\reports dealing with test accounts(not production).

Also, went through the whole Oauth2 credentials for account [A], allowed test emails, and after running "examples/authentication/authenticate_in_web_application.py", I am redirected to a webpage, allow my main test manager account to access the second test manager account[B](as instructed by the documentation, to create another test manager account[B], besides the main account[A] with the developer token), a refresh token is generated successfully from this OAuth2 prompt, to allow account [B] to be managed my account [A], added the refresh token to my google-ads.yaml file, and things are all good.

When I run this .py file from the examples

python3 google-ads-python/examples/account_management/list_accessible_customers.py 

The result is this:

Total results: 2 Customer resource name: "customers/1792845307" Customer resource name: "customers/5341438919" 

Lovely, took 2 days to get this far. And it's been two days now trying to get past the following. Please note that the above results are both from my account [B], the API request to get these results was made while the developer token for account [A] is set in the google-ads.yaml file.

So, the .yaml file for now contains Developer account token for account [A], OAuth creds for account[A] on cloud console(.json) file. The refresh token for account [B] that resulted from the Authentication in step1.

Moving on, by running "get_account_information.py", which is also in the examples folder, and passing to it one of the accounts from the above result[mandatory flag --c, which is the client id), I keep getting an access denied error:

python3 get_account_information.py --c 5341438919 I get this:

Request with ID "LhKeU9ZI4zZgnp05VSHbjg" failed with status "PERMISSION_DENIED" and includes the following errors: 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. See https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid".``` 

I have tried setting "the manager's customer id must be set in the 'login-customer-id' ", this login-customer-id is located in the .yaml file. I have tried setting that to both the results from the call in step 2. I also tried adding the account manager ID from account[A]. I tried manually adding account [A] as an account manager for account [B] from withing google-ads's UI, then tried setting the "login-customer-id" again for all these accounts these linking processes, yet, failed miserably.

I am facing this access denied for all the .py files in the example directory. Tried to be as thorough and verbose as possible for this lengthy process, hoping it'll make sense. If you have tried to work with this API, you will understand what I mean, and I look forward to any insight\help\input regarding this, even if you haven't worked with this API.

In the documentation, the guide says that after creating a test developer manager account, all accounts below that will be also test accounts, and will be designated by a red label saying "TEST", otherwise it's a production account. Both accounts [A]+[B] above are test manager\developer accounts, yet don't have any red labels stating they are tests, neither any children I tried creating under them. So I wonder if the error\roadblock I am facing is due to them not being designated as test accounts? But why are they being listed as "Accessible accounts" in Step2.

Thanks a lot! If any other pieces of info should be required, I shall provide.

When I am trying to use webpack in order to build my project and use it on AWS Lambda, I am getting a lot of warnings related to Critical dependency of ./node_modules/grpc. This issue happening once I import {GoogleAdsApi} from 'google-ads-api'; As I can understand this is related to dynamic importing, I might be wrong. As a result, the bundled file is huge (above 4MB) and when zipping it and using it on the Lambda I am getting the following error when the Lambda is triggered: "package.json does not exist at /package.json"

*Typescript
*Node ver 12.x

index.ts

import {GoogleAdsApi} from 'google-ads-api'; export const handler = async (event: any): Promise<any> => {   try {     console.log('Start', event);     // @ts-ignore     const api = new GoogleAdsApi({client_id: 'id', client_secret: 'secret', developer_token: 'dToken'});     return 'success';   } catch (e) {     console.log('Error', e);     throw e;   } }; 
Error: package.json does not exist at /package.json, at Object.exports.find (/var/task/webpack:/node_modules/node-pre-gyp/lib/pre-binding.js:18:1), at Object.<anonymous> (/var/task/webpack:/node_modules/grpc/src/grpc_extension.js:29:1), at Object.<anonymous> (/var/task/index.js:40079:30), at __webpack_require__ (/var/task/webpack:/webpack/bootstrap:19:1), at Object.<anonymous> (/var/task/webpack:/node_modules/grpc/src/client_interceptors.js:144:12), at __webpack_require__ (/var/task/webpack:/webpack/bootstrap:19:1), at Object.<anonymous> (/var/task/webpack:/node_modules/grpc/src/client.js:35:27), at __webpack_require__ (/var/task/webpack:/webpack/bootstrap:19:1), at Object.<anonymous> (/var/task/webpack:/node_modules/grpc/index.js:27:14), at Object.<anonymous> (/var/task/index.js:2460:30) 

Webpack Warnings Webpack Warnings:

WARNING in ./node_modules/bytebuffer/dist/bytebuffer-node.js 29:38-55 Module not found: Error: Can't resolve 'memcpy' in    WARNING in ./node_modules/google-ads-node/node_modules/import-fresh/index.js 28:8-25 Critical dependency: the request of a dependency is an expression WARNING in ./node_modules/grpc/src/grpc_extension.js 32:12-33 Critical dependency: the request of a dependency is an expression WARNING in ./node_modules/node-pre-gyp/lib/pre-binding.js 20:22-48 Critical dependency: the request of a dependency is an expression WARNING in ./node_modules/node-pre-gyp/lib/util/versioning.js 17:20-67 Critical dependency: the request of a dependency is an expression 

webpack.config.js:

`const path = require("path") const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin") module.exports = { mode: "production", entry: "./src/index.ts", resolve: { extensions: [".js", ".jsx", ".json", ".ts", ".tsx"], }, output: { libraryTarget: "commonjs", path: path.join(__dirname, "dist"), filename: "index.js", }, target: "node", module: { rules: [ { // Include ts, tsx, js, and jsx files. test: /.(ts|js)x?$/, exclude: /node_modules/, use: [ { loader: "cache-loader", options: { cacheDirectory: path.resolve(".webpackCache"), }, }, "babel-loader", ], }, ], }, plugins: [new ForkTsCheckerWebpackPlugin()], }` 

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;         }     }