Skip to content

Fix runtime errors in add_responsive_search_ad_full.rb - #576

Open
pattersonlois wants to merge 3 commits into
googleads:mainfrom
pattersonlois:fix-add-responsive-search-ad-full
Open

pattersonlois wants to merge 3 commits into
googleads:mainfrom
pattersonlois:fix-add-responsive-search-ad-full

Conversation

@pattersonlois

@pattersonlois pattersonlois commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor
  • Replace nonexistent client.operation.create_*, client.enum.served_asset_field_type.HEADLINE_1, and client.request.suggest_geo_target_constants calls with client.operation.create_resource.*, :HEADLINE_1, and client.resource.location_names + keyword arguments on suggest_geo_target_constants.
  • Pass customizer_attribute_name (instead of customizer_attribute_resource_name) into {CUSTOMIZER.<name>:10USD}, and make -n/--customizer-attribute-name optional (nil default instead of forcing 'Price') so repeat runs do not fail with DUPLICATE_CUSTOMIZER_ATTRIBUTE_NAME and both description branches remain reachable.
  • Set required contains_eu_political_advertising and client.resource.target_spend (omitting read-only bidding_strategy_type and deprecated target_spend_micros) in create_campaign.
  • Add missing require 'securerandom', unescape #{SecureRandom.uuid} and puts resource-name interpolations, standardize single-quoted string literals, fix the LOCALE default comment ('en') and DevSite customizer/geotargets URLs, rename main_function to add_responsive_search_ad_full (instantiating GoogleAdsClient.new inside it), and align CLI OptionParser (INSERT_CUSTOMER_ID_HERE, -h/--help) and GoogleAdsError $stderr handling with repository conventions.

@pattersonlois

Copy link
Copy Markdown
Contributor Author

Note for review on coordination with #575:

@pattersonlois

Copy link
Copy Markdown
Contributor Author

Made fixes following dorasun's Google doc feedback.

@pattersonlois
pattersonlois force-pushed the fix-add-responsive-search-ad-full branch from 9617baa to c240784 Compare November 23, 2026 20:29
@pattersonlois

Copy link
Copy Markdown
Contributor Author

Rebased onto main (incorporating #575's opts.banner and commented campaign date updates), restored .map + \ line-end string continuation in add_geo_targeting, aligned the OptionParser comment with options.fetch(:customer_id), and set 100755 file permissions.

@pattersonlois

Copy link
Copy Markdown
Contributor Author

Updated add_responsive_search_ad_full.rb to align further with repository example conventions:

  • Moved GoogleAdsClient.new inside add_responsive_search_ad_full(customer_id, customizer_attribute_name = nil) (matching add_responsive_search_ad_with_ad_customizer.rb and add_performance_max_campaign.rb).
  • Added the standard options[:customer_id] = 'INSERT_CUSTOMER_ID_HERE' placeholder block and removed the custom rescue KeyError branch.
  • Removed the redundant # 500,000 inline comment on cb.amount_micros = 500_000.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant