Posts tagged with google-ads-api

So I'm using ruby client library. Version of gem 'google-ads-googleads' is 21.0.0 and Google Ads API version is 13. After initialising client with my credentials, I try to query one of the Google Ads Get Account Hierarchy endpoint, I get Error message:

<Google::Ads::GoogleAds::V13::Errors::GoogleAdsFailure: errors: [<Google::Ads::GoogleAds::V13::Errors::GoogleAdsError: error_code: <Google::Ads::GoogleAds::V13::Errors::ErrorCode: query_error: :UNEXPECTED_END_OF_QUERY>, message: "Error in query: unexpected end of query.">], request_id: "koqtfsaS6CTB0FxlCHucKg">

client = Google::Ads::GoogleAds::GoogleAdsClient.new do |config|       config.client_id = client_id       config.client_secret = client_secret       config.refresh_token = access_token       config.developer_token = developer_token end google_ads_service = client.service.google_ads query = <<~QUERY       SELECT         customer_client.client_customer,         customer_client.level,         customer_client.manager,         customer_client.descriptive_name,         customer_client.currency_code,         customer_client.time_zone,         customer_client.id       FROM customer_client       WHERE customer_client.level <= 1     QUERY begin    request = google_ads_service.search_stream do |search|         search.customer_id = '8148704352'         search.query = query         search.page_size = 100     end     request.each do |response|                           response.results.each do |row|            puts row        end     end rescue Google::Ads::GoogleAds::Errors::GoogleAdsError => e     puts "Error message: #{e.failure}" end 

I tried

query = <<~SQL   SELECT     customer_client.client_customer,     customer_client.level,     customer_client.manager,     customer_client.descriptive_name,     customer_client.currency_code,     customer_client.time_zone,     customer_client.id   FROM customer_client   WHERE customer_client.level <= 1 SQL 

I also tried enclosing query in single quotes like query_with_single_quotes = ''' + query + ''' but the error doesn't go away.

I'm trying to make a call to the Google ADS API through the ga_service.search_stream(my_query) method using the client.get_service("GoogleAdsService"). However i'm getting the error: " Version v10 is deprecated. Requests to this version will be blocked."

I run the print(google.ads.googleads.VERSION) code and I get the response that the installed version is v16.0.0 however I passed the version to GoogleAdsClient like this: GoogleAdsClient.load_from_storage("my_file.yaml", version=" v16")

In response I got the following error: Specified Google Ads API version "v16" does not exist. Valid API versions are: "v10", "v9"

I made the same call to the method GoogleAdsClient.load_from_storage("my_file.yaml", version=" v10") and GoogleAdsClient.load_from_storage("my_file.yaml", version=" v9")

I made the same call to the method GoogleAdsClient.load_from_storage("my_file.yaml", version=" v10") and got response: Version v10 is deprecated. Requests to this version will be blocked."

When I run GoogleAdsClient.load_from_storage("my_file.yaml", version=" v9") I get the response: google.api_core.exceptions.MethodNotImplemented: 501 GRPC target method can't be resolved

Can you help me? This issue may be associated with settings on the GoogleAds platform?

Good days, I am trying to install the library with the "pecl install grpc" command and it is returning the following error: "Fatal error: Array and string offset access syntax with curly braces is no longer supported in C:\xampp\php\pear\PEAR\Config.php on line 2095".

I don't know why but it gives a PHP related syntax error.

The PHP version I'm using is:

"PHP 8.2.0 (cli) (built: Dec 6 2022 15:31:23) (ZTS Visual C++ 2019 x64) Copyright (c) The PHP Group Zend Engine v4.2.0, Copyright (c) Zend Technologies"

And it is not only that file but many more with which it gives a syntax error.

Tried reinstalling PHP and Xampp

Any solution or idea on how to fix it or install it properly?

Thank you.

I'm attempting to add Google Ads conversion tracking within a React App. In this situation I need to set it up to trigger on click as opposed to page URL. Within the index.html I added the Google Tag and the Conversion Event Snippet without issues.

My Question: How do I now call the function on a React Component to trigger a conversion?

<!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=AW-______"></script> <script>window.dataLayer = window.dataLayer || [];   function gtag(){dataLayer.push(arguments);}   gtag('js', new Date());   gtag('config', 'AW-______');</script> 

Event Snippet:

<!-- Event snippet for Payment conversion page In your html page, add the snippet and call gtag_report_conversion when someone clicks on the chosen link or button. --> <script>function gtag_report_conversion(url) {   var callback = function () {     if (typeof(url) != 'undefined') {       window.location = url;     }   };   gtag('event', 'conversion', {       'send_to': 'AW-_____/_____',       'transaction_id': '',       'event_callback': callback   });   return false; }</script>