Skip to content

update_campaign / draft_campaign: set the location option (presence vs presence-or-interest) #104

Closed

Description

@xgp

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:

  • positive_geo_target_type: PositiveGeoTargetType (PRESENCE_OR_INTEREST, SEARCH_INTEREST, PRESENCE)
  • negative_geo_target_type: NegativeGeoTargetType (PRESENCE_OR_INTEREST, PRESENCE)

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.

Activity

  1. kLOsk commented on Oct 27, 2026

    @kLOsk
    Owner

    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.

  2. xgp commented on Oct 27, 2026

    @xgp
    ContributorAuthor

    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.

  3. added a commit that references this issue on Oct 27, 2026
    b41d76b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions