Skip to content

update_campaign / draft_campaign: set campaign URL options (tracking template, final URL suffix, custom parameters) #105

Closed

Description

@xgp

Situation. We tag all paid traffic with UTM parameters through a campaign-level tracking template, so analytics can attribute sessions and conversions by campaign, ad group and keyword. After building two Search campaigns through AdLoop, the template was one of the few settings that still needed the Google Ads UI. The weekly check also can't confirm it's still set without a hand-written GAQL query.

What I tried. draft_campaign and update_campaign have no URL options. run_gaql reads campaign.tracking_url_template (both new campaigns: empty), but nothing writes it.

What the API offers. Three fields on Campaign:

  • tracking_url_template: a string with {lpurl} and ValueTrack parameters
  • final_url_suffix
  • url_custom_parameters: a list of CustomParameter{key, value}

Proposed change. Optional tracking_url_template, final_url_suffix and url_custom_parameters on draft_campaign and update_campaign, all omitted by default. Validation:

  • the template must contain {lpurl} or one of its variants
  • custom parameter keys and values are checked against Google's length limits

The preview would show the template applied to the campaign's final URL, so a typo is visible before it's applied. The dry run already catches anything Google rejects.

Happy to PR once you're happy with the shape. It touches the same files as the location option (#104), so the two could share a PR or go one after the other, whichever you prefer.

Activity

  1. kLOsk commented on Oct 27, 2026

    @kLOsk
    Owner

    Yes, also welcome, as its own PR after or alongside #104:

    • Optional tracking_url_template, final_url_suffix and url_custom_parameters on draft_campaign and update_campaign. Omitted means unchanged; an empty string (or an empty list) clears the value, and the preview shows that as a removal.
    • Keep our own validation light: {lpurl} (or one of its variants) in the template, and the key and value length limits. The validate_only dry run catches anything else Google rejects.
    • Showing the template applied to the campaign's final URL in the preview is a great idea, please do.

    get_campaign_settings reads all three back since 0.36.0.

  2. xgp commented on Oct 27, 2026

    @xgp
    ContributorAuthor

    Thanks. PR is up: #116, separate from #115. Omitted is unchanged; ""/[] clears it and the preview names the removal. Validation is just {lpurl} and the key/value lengths. example_click in the preview shows one of the campaign's final URLs with the template applied.

  3. added a commit that references this issue on Oct 27, 2026
    ebde590
  4. added a commit that references this issue on Oct 28, 2026
    44cd67e
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