You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
update_campaign / draft_campaign: set the location option (presence vs presence-or-interest) #104
Situation. I built two Search campaigns for a low-volume B2B product end to end through AdLoop: campaigns, ad groups, keywords, negatives, pinned RSAs, assets, AI Max off. The location option was one of the few settings that still needed the Google Ads UI. The campaigns target about a dozen countries, and Google's default, presence or interest, also shows the ads to people elsewhere who search about those countries. We need presence only.
What I tried.draft_campaign and update_campaign have no parameter for it. Reading it back is possible with run_gaql (campaign.geo_target_type_setting.positive_geo_target_type), and both new campaigns read PRESENCE_OR_INTEREST.
What the API offers.Campaign.geo_target_type_setting:
Both are plain fields on the campaign, so they can go in the same campaign mutate draft_campaign already sends, or into update_campaign's update mask.
Proposed change. An optional location_option (and maybe negative_location_option) on both tools. Empty means "leave it to Google", so existing callers see no change. Validate against the enum, show old → new in the update_campaign preview, and pick it up in the dry run like every other campaign field.
Happy to PR. If the approach suits you I can open one: ads/write.py (draft + apply), the two tool signatures and docstrings in server.py, tests, and the rules file through scripts/sync-rules.py. Related: the tracking template (#105) and campaign-level broad match (#106), the other two settings that still need the UI after an API build.
Yes please, a PR is welcome. The shape you describe is what we'd want:
Optional location_option (PRESENCE, PRESENCE_OR_INTEREST, SEARCH_INTEREST) and negative_location_option (PRESENCE, PRESENCE_OR_INTEREST) on draft_campaign and update_campaign. Empty leaves Google's default, so existing callers see no change.
The update_campaign preview shows old → new. When the change widens reach (anything other than PRESENCE), say so in a warning; a single confirmation is enough.
The dry run goes through validate_only like the other campaign fields.
get_campaign_settings (shipped in 0.36.0) already reads both fields back, so tests and the weekly audit can use it. Please keep this separate from #105; two small PRs are easier to review than one.
Thanks. PR is up: #115. It follows your shape: optional on both tools, old → new in the update_campaign preview, a warning when the change widens reach (only when the value actually changes), single confirmation, validate_only dry run. Kept separate from #105, which is #116.
Activity
kLOsk commentedon Oct 27, 2026
Yes please, a PR is welcome. The shape you describe is what we'd want:
location_option(PRESENCE,PRESENCE_OR_INTEREST,SEARCH_INTEREST) andnegative_location_option(PRESENCE,PRESENCE_OR_INTEREST) ondraft_campaignandupdate_campaign. Empty leaves Google's default, so existing callers see no change.update_campaignpreview shows old → new. When the change widens reach (anything other thanPRESENCE), say so in a warning; a single confirmation is enough.validate_onlylike the other campaign fields.get_campaign_settings(shipped in 0.36.0) already reads both fields back, so tests and the weekly audit can use it. Please keep this separate from #105; two small PRs are easier to review than one.xgp commentedon Oct 27, 2026
Thanks. PR is up: #115. It follows your shape: optional on both tools, old → new in the
update_campaignpreview, a warning when the change widens reach (only when the value actually changes), single confirmation,validate_onlydry run. Kept separate from #105, which is #116.Location option on draft_campaign and update_campaign (kLOsk#115)