Skip to content

Using SearchSettings in V18 #506

Description

@trwong

What is your question?

Before V18 I was making the following call:

@config_path = Rails.root.join("...").to_s
@google_ads_client = Google::Ads::GoogleAds::GoogleAdsClient.new(@config_path)
click_view_report = @google_ads_client.service.google_ads.search(
  customer_id: @account_id.delete("-"),
  query: click_view_query,
  return_total_results_count: true
)

After V18 return_total_results_count should be passed as type SearchSettings from the docs here: https://developers.google.com/google-ads/api/docs/release-notes#reporting

I've tried a couple work arounds like passing a Google::Protobuf::Struct.new and a hash like so:

@config_path = Rails.root.join("...").to_s
@google_ads_client = Google::Ads::GoogleAds::GoogleAdsClient.new(@config_path)
click_view_report = @google_ads_client.service.google_ads.search(
  customer_id: @account_id.delete("-"),
  query: click_view_query,
  search_settings: {
    return_total_results_count: true
  }
)

What is the right way to pass search_settings into this call?

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions