I'm using Google Ads API PHP library in my system. But I didn't found following 2 API's in provided API list here https://developers.google.com/google-ads/api/docs/account-management/create-account:

  1. API to find out whether user has already exist Google Ads account using email? If found then returns his 10 digit customer ID.
  2. If user Google Ads account not found then create new Google Ads account (manager account on behalf of customer through our PHP script). So that after creating, I can link it under my manager account.

I have seen same process on few sites. Whenever user visits system, he entering his email address, name, etc.. then script searches for his existing Google Ads account if found return customer id or some data & auto logged-in to system otherwise creates new Google Ads manager account for him.

Please let me know any API or solution for these 2 cases.

I am using google ads api and displaying Google adwords ads on our site. At every request the terminal displaying logging request and response. I want to know that is there any way to disable request/response Info from console. I am using google ads java library. I tried to use new RequestLogger But I could not disable that. Below is the given message type which I am getting at every google ads api call.

com.google.api.client.http.HttpTransport [] - -------------- REQUEST  -------------- POST https://oauth.googleapis.com/token Accept-Encoding: gzip User-Agent: Google-HTTP-Java-Client/1.39.0 (gzip) Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Content-Length: 241 com.google.api.client.http.HttpTransport [] - curl -v --compressed -X POST -H 'Accept-Encoding: gzip' -H 'User-Agent: Google-HTTP-Java-Client/1.39.0 (gzip)' -H 'Content-Typ e: application/x-www-form-urlencoded; charset=UTF-8' -d '@-' -- 'https://oauth2.googleapis.com/token' << $$$ com.google.api.client.http.HttpTransport [] - Total: 241 bytes com.google.api.client.http.HttpTransport [] - client_id=xxxx&refresh_token=xxxx&grant_type=refresh_token com.google.api.client.http.HttpTransport [] - -------------- RESPONSE -------------- HTTP/1.1 200 OK Transfer-Encoding: chunked Alt-Svc: h3=":443"; ma=2592000,h3-29=":111"; ma=333,h3-T051=":3"; ma=000,h3-Q050=":443"; ma=2000,h3-Q046=":443"; ma=2592000,h3-Q043=":443" 46,43" Server: scaffolding on HTTPServer2 X-Content-Type-Options: nosniff Pragma: no-cache 

I am having an issue with Google Adwords API and can't seem to get it to work.

I have taken the following steps:

  • Installed composer
  • Installed Google Adwords API
  • Created a Developer Token
  • Created Oauth2
  • Created a Refresh Token
  • Updated all of the above inside of adsapi_php which is in the root
  • I also have Basic access to the API
<?php namespace Google\AdsApi\Examples\AdWords\v201809\Reporting; require __DIR__ . '/vendor/autoload.php'; use Google\AdsApi\AdWords\AdWordsServices; use Google\AdsApi\AdWords\AdWordsSession; use Google\AdsApi\AdWords\AdWordsSessionBuilder; use Google\AdsApi\AdWords\v201809\cm\ReportDefinitionReportType; use Google\AdsApi\AdWords\v201809\cm\ReportDefinitionService; use Google\AdsApi\Common\OAuth2TokenBuilder; /**  * This example gets the fields available in a campaign report.  */ class GetReportFields{     const PAGE_LIMIT = 500;     public static function runExample(AdWordsServices $adWordsServices,         AdWordsSession $session){         $reportDefinitionService = $adWordsServices->get($session, ReportDefinitionService::class);         // The type of the report to get fields for.         $reportType = ReportDefinitionReportType::CAMPAIGN_PERFORMANCE_REPORT;         // Get report fields of the report type.         $reportDefinitionFields = $reportDefinitionService->getReportFields($reportType);         printf(             "The report type '%s' contains the following fields:\n",             $reportType         );         foreach ($reportDefinitionFields as $reportDefinitionField) {             printf(                 '  %s (%s)',                 $reportDefinitionField->getFieldName(),                 $reportDefinitionField->getFieldType()             );             if ($reportDefinitionField->getEnumValues() !== null) {                 printf(                     ' := [%s]',                     implode(', ', $reportDefinitionField->getEnumValues())                 );             }             print "\n";         }     }     public static function main(){         // Generate a refreshable OAuth2 credential for authentication.         $oAuth2Credential = (new OAuth2TokenBuilder())->fromFile()->build();         // Construct an API session configured from a properties file and the         // OAuth2 credentials above.         $session = (new AdWordsSessionBuilder())->fromFile()->withOAuth2Credential($oAuth2Credential)->build();         self::runExample(new AdWordsServices(), $session);     } } GetReportFields::main(); ?> 

But I am receiving the following error:

Fatal error: Uncaught Google\AdsApi\AdWords\v201809\cm\ApiException: [QuotaCheckError.INVALID_TOKEN_HEADER @ ; trigger:'New developers must use the Google Ads API: https://developers.google.com/google-ads/api/docs/start'] in C:\xampp\htdocs\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\Util\Reflection.php:43 Stack trace:  #0 C:\xampp\htdocs\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\Util\Reflection.php(43): ReflectionClass->newInstanceArgs(Array) #1 C:\xampp\htdocs\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\AdsSoapClient.php(203): Google\AdsApi\Common\Util\Reflection->createInstance('Google\\AdsApi\\A...', Array) #2 C:\xampp\htdocs\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\AdsSoapClient.php(165): Google\AdsApi\Common\AdsSoapClient->parseApiExceptionFromSoapFault(Object(SoapFault)) #3 C:\xampp\htdocs\vendor\googleads\googleads-php-lib\src\Google\AdsApi\AdWords\v201809\cm\ReportDefinitionService.php(89): Google\AdsApi\Common\AdsSoapClient->__soapCall('getReportFields', Array) #4 C:\xampp\htdocs\adwords.php(31): Google\AdsApi\AdWords\v201809\cm\ReportDefinitionService->getReportFields('CAMPAIGN_PERFOR...') #5 C:\xampp\htdocs\adwords.php(61): Google\AdsApi\Examples\AdWords\v201809\Reporting\GetReportFields::runExample(Object(Google\AdsApi\AdWords\AdWordsServices), Object(Google\AdsApi\AdWords\AdWordsSession)) #6 C:\xampp\htdocs\adwords.php(65): Google\AdsApi\Examples\AdWords\v201809\Reporting\GetReportFields::main() #7 {main} thrown in C:\xampp\htdocs\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\Util\Reflection.php on line 43 

Now I am certain the credentials are all correct. Inside of https://developers.google.com/adwords/api/docs/common-errors#QuotaCheckError.INVALID_TOKEN_HEADER it states there are only two potential issues:

  • The developer token is not set on the request or it contains a typo.
  • The namespace of the headers in the request is not correct.

So the only issue could be the namespace of the headers but I do not understand how to: "Ensure that the headers of the request are in the namespace https://adwords.google.com/api/adwords/cm/{version}, where {version} is replaced with the version of the API being used."

Where do I find the version to confirm if this is the issue or if it is somehow that I am using the wrong API which a new developer tokens are unable to be used on: https://developers.google.com/adwords/api/docs/guides/signup? Although I did follow the new documentation to the letter...

Or is it that it is unable to find the adsapi_php? Thus it is always wrong? Any advice for finding out where the issues lies? I have been trying to troubleshoot this since 10am this morning.

If it helps here is my composer.json:

{     "name": "phpmyadmin/phpmyadmin",     "type": "project",     "description": "A web interface for MySQL and MariaDB",     "keywords": ["phpmyadmin","mysql","web"],     "homepage": "https://www.phpmyadmin.net/",     "support": {         "forum": "https://www.phpmyadmin.net/support/",         "issues": "https://github.com/phpmyadmin/phpmyadmin/issues",         "wiki": "https://wiki.phpmyadmin.net/",         "docs": "https://docs.phpmyadmin.net/",         "source": "https://github.com/phpmyadmin/phpmyadmin"     },     "license": "GPL-2.0-only",     "authors": [         {             "name": "The phpMyAdmin Team",             "email": "developers@phpmyadmin.net",             "homepage": "https://www.phpmyadmin.net/team/"         }     ],     "non-feature-branches": ["RELEASE_.*"],     "autoload": {         "psr-4": {             "PhpMyAdmin\\": "libraries/classes"         }     },     "autoload-dev": {         "psr-4": {             "PhpMyAdmin\\Tests\\": "test/classes",             "PhpMyAdmin\\Tests\\Selenium\\": "test/selenium/"         }     },     "repositories": [         {             "type": "composer",             "url": "https://www.phpmyadmin.net"         }     ],     "require": {         "php": "^7.1.3 || ^8.0",         "ext-hash": "*",         "ext-iconv": "*",         "ext-json": "*",         "ext-mysqli": "*",         "ext-pcre": "*",         "ext-xml": "*",         "firebase/php-jwt": "^3.0",         "google/apiclient": "^2.0",         "google/gax": "^1.7",         "google/recaptcha": "^1.1",         "googleads/google-ads-php": "^10.1",         "googleads/googleads-php-lib": "^53.0",         "guzzlehttp/guzzle": "^7.0",         "nikic/fast-route": "^1.3",         "phpmyadmin/motranslator": "^5.0",         "phpmyadmin/shapefile": "^2.0",         "phpmyadmin/sql-parser": "^5.0",         "phpmyadmin/twig-i18n-extension": "^3.0",         "phpseclib/phpseclib": "^2.0",         "react/http": "^1.4",         "spatie/crawler": "^7.0",         "symfony/config": "^4.4.9",         "symfony/dependency-injection": "^4.4.9",         "symfony/expression-language": "^4.4.9",         "symfony/polyfill-ctype": "^1.17.0",         "symfony/polyfill-mbstring": "^1.17.0",         "twig/twig": "^2.9 || ^3",         "williamdes/mariadb-mysql-kbs": "^1.2"     },     "conflict": {         "phpseclib/phpseclib": "2.0.8",         "tecnickcom/tcpdf": "<6.2",         "pragmarx/google2fa": "<6.1.0 || >8.0",         "pragmarx/google2fa-qrcode": "<1.0.1",         "samyoul/u2f-php-server": "<1.1"     },     "suggest": {         "ext-openssl": "Cookie encryption",         "ext-curl": "Updates checking",         "ext-opcache": "Better performance",         "ext-zlib": "For gz import and export",         "ext-bz2": "For bzip2 import and export",         "ext-zip": "For zip import and export",         "ext-gd2": "For image transformations",         "ext-mbstring": "For best performance",         "tecnickcom/tcpdf": "For PDF support",         "pragmarx/google2fa-qrcode": "For 2FA authentication",         "samyoul/u2f-php-server": "For FIDO U2F authentication"     },     "require-dev": {         "php-webdriver/webdriver": "^1.11",         "phpmyadmin/coding-standard": "^2.1.1",         "phpstan/extension-installer": "^1.1",         "phpstan/phpstan": "^0.12.79",         "phpstan/phpstan-phpunit": "^0.12.17",         "phpunit/phpunit": "^7.5 || ^8.0 || ^9.0",         "pragmarx/google2fa-qrcode": "^1.0.1",         "samyoul/u2f-php-server": "^1.1",         "symfony/console": "^4.4",         "symfony/finder": "^4.4",         "symfony/twig-bridge": "^4.4",         "tecnickcom/tcpdf": "^6.4.1",         "vimeo/psalm": "^4.7.0",         "google/apiclient": "^2.0",         "guzzlehttp/guzzle": "^7.0",         "firebase/php-jwt": "^3.0"     },     "extra": {         "branch-alias": {             "dev-master": "5.2.x-dev"         }     },     "scripts": {         "phpcbf": "phpcbf",         "phpcs": "phpcs",         "phpstan": "phpstan analyse",         "psalm": "psalm",         "phpunit": "phpunit --color=always",         "test": [             "@phpcs",             "@phpstan",             "@psalm",             "@phpunit"         ],         "update:baselines": "phpstan analyse --generate-baseline && psalm --set-baseline=psalm-baseline.xml",         "twig-lint": "php scripts/console lint:twig templates --ansi --show-deprecations"     },     "config":{         "sort-packages": true,         "discard-changes": true     } } 

I have a desktop app for Windows. it's written in C++. We're promoting the software using Google Adwords.

We would like to count installations of the software as a conversion on Google Ads, so the algorithm can optimize for it. But all I can find is for Mobile Apps, hooking up with Firebase or Google Analytics, but in the set up it's asking for App ID's on Google Play or Apple's AppStore which doesn't fit my case.

Has anyone done this before? or could some point in the right direction?

I haven't tried the standard pixel approach, because cookies are in the browser that generates the download, but not in the installed software itself, so there is no way for attribution to work correctly