Repository navigation
draft_campaign / update_campaign: location option - #115
Merged
Merged
Conversation
…ce-or-interest) Optional location_option (PRESENCE, PRESENCE_OR_INTEREST, SEARCH_INTEREST) and negative_location_option (PRESENCE, PRESENCE_OR_INTEREST) on both tools. Empty leaves Google's default, so existing callers see no change. The update_campaign preview shows the current value next to the new one and warns when the change widens reach; a single confirmation. The dry run goes through validate_only with the other campaign fields. Fixes kLOsk#104.
This was referenced Oct 27, 2026
Closed
kLOsk
reviewed
Oct 27, 2026
kLOsk
left a comment
Owner
There was a problem hiding this comment.
Merging, thanks. One correction we'll make in a follow-up commit: the rules bullet says "anything but PRESENCE widens reach", which is right for the positive option and reversed for the negative one (negative PRESENCE excludes fewer people). The code already warns correctly; only the text was wrong. Also, the "unchanged, no warning" case isn't re-checked at apply, so a UI change in between would go through silently. That's fine for now, same as search partners today.
kLOsk
added a commit
that referenced
this pull request
Oct 27, 2026
Follow-up to #115: the rules said "anything but PRESENCE widens reach", which holds for location_option and is reversed for negative_location_option, where PRESENCE excludes only people physically in the excluded places. The code already warned correctly; the rules and both tool descriptions now say the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TiC3mRmhzUVXgCexry7GJ3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #104.
Adds optional
location_optionandnegative_location_optiontodraft_campaignandupdate_campaign, in the shape agreed on the issue.Parameters
location_optionPRESENCE,PRESENCE_OR_INTEREST,SEARCH_INTERESTcampaign.geo_target_type_setting.positive_geo_target_typenegative_location_optionPRESENCE,PRESENCE_OR_INTERESTcampaign.geo_target_type_setting.negative_geo_target_typeValues are case-insensitive. Empty leaves the value as it is: on
draft_campaignthat means Google's default, so existing callers get the same request and the same preview as before. A test pins that.Preview
update_campaignreads the campaign's current options and puts them next to the new ones inchanges:current_location_option→location_option, andcurrent_negative_location_option→negative_location_option. This follows thecurrent_daily_budgetpattern. An unknown campaign is refused at draft time.PRESENCEadds a warning that the change widens reach.PRESENCEadds a warning that the exclusions now exclude fewer people. The negative side runs the other way round:PRESENCE_OR_INTERESTis the wider exclusion.update_campaign, a value the campaign already has produces no warning.requires_double_confirmstays false.Apply and dry run
Both options go on the campaign operation the tool already builds:
network_settings;update_maskpaths:geo_target_type_setting.positive_geo_target_type/.negative_geo_target_type.So the dry run is the existing
validate_onlypath; nothing new.I ran a validate-only dry run against a paused Search campaign in a live account. It came back
DRY_RUN_SUCCESSwithvalidated_calls: 1. Nothing was applied.Rules and tests
.cursor/rules/adloop.mdcnow has the tool table entries and one bullet on what the options mean. Synced withscripts/sync-rules.py.tests/test_location_option.py(16 tests) covers:PRESENCE, and the wider values;uv run pytestgives 1679 passed, 2 skipped.get_campaign_settingsreads both fields back, as you noted. Docs left for you to regenerate after the release, as with #110.