Posts under category google-ads-api

I'm looking for an API operation to enable enhanced conversions on a conversion action

Looking at this doc, it only mentions enabling enhanced conversions in the UI: https://developers.google.com/google-ads/api/docs/conversions/enhance-conversions?hl=en

This reference doc doesn't include any fields that seem to have anything to do with enhanced conversions: https://developers.google.com/google-ads/api/reference/rpc/v13/ConversionAction

Is there a way to enable enhanced conversions via a API?

This should be extremely easy but I've struggling a couple of hours and I cannot get through it. I'm trying to import the module 'adwords' with this code:

import datetime import urllib.parse import uuid from googleads import adwords 

I keep getting this error:

(my_env) C:\Users\Trabajo\test>python adwords_test.py
Traceback (most recent call last): File "C:\Users\Trabajo\test\adwords_test.py", line 5, in from googleads import adwords ImportError: cannot import name 'adwords' from 'googleads' (C:\Users\Trabajo\anaconda3\envs\my_env\lib\site-packages\googleads_init_.py)

I have this modules installed (can provide full list if needed):

google-ads==21.1.0 google-api-core==2.11.0 google-auth==2.17.3 google-auth-oauthlib==0.8.0 googleads==37.0.0 googleapis-common-protos==1.59.0 [...] 

I tried different ways to import the module, based on a chatGPT response:

from googleads import adwords from google.ads.google_ads import adwords 

neither worked 😔

I also tried to uninstall and install again both googleads and google_ads modules, as I'm pretty sure it has something to do with googleads version.

Thank you!

I'm attempting to use the Google Ads API Client Library for PHP with a Service Account json.

Inviting the Service Account to Google Ads account has status of "Awaiting response" - but I cannot login to the Service Account to accept the invite.

Here is the code being used:

<?php // Include the Google Ads API PHP client library require_once 'googleads_google-ads-php/vendor/autoload.php'; use Google\Ads\GoogleAds\Lib\V13\GoogleAdsClientBuilder; use Google\Ads\GoogleAds\Lib\V13\GoogleAdsServerStreamDecorator; use Google\Ads\GoogleAds\Util\V13\ResourceNames; use Google\Ads\GoogleAds\V13\Services\GoogleAdsQuery; use Google\Ads\GoogleAds\Lib\OAuth2TokenBuilder; $developerToken = "developerToken"; $jsonKeyFilePath = "json_key.json"; $customerId = "CustomerId"; // Set up authentication using a service account JSON file $googleAdsClient = (new GoogleAdsClientBuilder())     ->withDeveloperToken($developerToken) ->withOAuth2Credential((new OAuth2TokenBuilder())     ->withJsonKeyFilePath($jsonKeyFilePath)     ->withScopes(['https://www.googleapis.com/auth/adwords'])     ->build())     ->build(); // Define the query to retrieve data from the age_range_view $query = "SELECT segments.date, segments.device, metrics.clicks, ad_group_criterion.criterion_id, ad_group_criterion.display_name           FROM age_range_view           LIMIT 1000"; try {     // Execute the query and get the results     $response = $googleAdsClient->getGoogleAdsServiceClient()->search($customerId, $query);     // Loop through the rows of data and extract the desired values     foreach ($response->iterateAllElements() as $googleAdsRow) {         $date = $googleAdsRow->getSegments()->getDate()->getValue();         $device = $googleAdsRow->getSegments()->getDevice()->getValue();         $clicks = $googleAdsRow->getMetrics()->getClicks()->getValue();         $criterionId = $googleAdsRow->getAdGroupCriterion()->getCriterionId()->getValue();         $displayName = $googleAdsRow->getAdGroupCriterion()->getDisplayName()->getValue();                  // Print the extracted values to the console         printf("Date: %s | Device: %s | Clicks: %d | Criterion ID: %d | Display Name: %s\n",             $date,             $device,             $clicks,             $criterionId,             $displayName         );     } } catch (GoogleAdsException $googleAdsException) {     printf("Request with ID '%s' has failed.%sGoogle Ads failure details:%s",         $googleAdsException->getRequestId(),         PHP_EOL,         PHP_EOL     );     foreach ($googleAdsException->getGoogleAdsFailure()->getErrors() as $error) {         /** @var GoogleAdsError $error */         printf("\t%s: %s%s",             $error->getErrorCode()->getErrorCode(),             $error->getMessage(),             PHP_EOL         );     } } catch (ApiException $apiException) {     printf("ApiException was thrown with message '%s'.%s",         $apiException->getMessage(),         PHP_EOL     ); } ?> 

Here is the error message:

PHP Fatal error:  Uncaught Google\ApiCore\ApiException: {     "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https:\/\/developers.google.com\/identity\/sign-in\/web\/devconsole-project.",     "code": 16,     "status": "UNAUTHENTICATED",     "details": [         {             "@type": "type.googleapis.com\/google.ads.googleads.v13.errors.GoogleAdsFailure",             "errors": [                 {                     "errorCode": {                         "authenticationError": "NOT_ADS_USER"                     },                     "message": "User in the cookie is not a valid Ads user."                 }             ],             "requestId": "requestId"         }     ] }   thrown in /data_import/googleads_google-ads-php/vendor/google/gax/src/ApiException.php on line 267 

I attempted to try adding ->withImpersonatedEmail($impersonatedEmail) to the authentication request with an account on the same project that has access to the Google Ads accounts but that did not work.

What am I missing?

Android code for sending data to firebase analytics:-

FirebaseAnalytics logger = FirebaseAnalytics.getInstance(activity); Bundle bundle = new Bundle(); bundle.putString("Type", type); logger.logEvent("RazorPay", bundle); 

This event is correctly recorded in Firebase Analytics but in Campaign section it have displayed as (not set) https://i.sstatic.net/X8E7i.png

I have also check log in Firebase debug view all data are correctly recorded https://i.sstatic.net/YfZ1Z.png

Does anyone understand what wrong is going here, why display (not set) value?, what exactly show instead of (not set)

Thank you in advance