googleads / googleads/google-ads-ruby

Using SearchSettings in V18

Open
#506 1 comment 0 reactions 1 assignee View on GitHub

@dorasun is already working on this.

Since Apr 9, 2025.

question
Dominant language
Ruby
Stars
83
Forks
72
Avg merge
16m
Merged PRs (30d)
1

Description

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?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.