Set Campaign UTMs
set_campaign_utmsSet or clear the UTM tracking parameters of ONE channel on a wizard campaign, merging into what the channel already stores.
KEYWORDS: utm, utms, set utm, change utm, utm_source, utm_medium, utm_campaign, utm_term, utm_content, tracking parameters, campaign override, UPDATE ME
USE THIS TOOL WHEN THE USER ASKS:
- "Set utm_source=Linkedin and utm_medium=paid-social on this campaign"
- "Fix the UPDATE ME placeholder in campaign X's UTMs"
- "Use utm_campaign=DG_Touch-3 on the LinkedIn channel"
INHERITANCE RULE - READ BEFORE ANSWERING ANY UTM QUESTION:
UTMs are inherited, never blank. A campaign channel with an empty stored
mapping does NOT have "no UTMs" - it tracks with the account's UTM defaults,
and where the account set nothing it tracks with the Metadata platform default.
Roughly half of all channel rows in production are in that inherited state.
NEVER report "no UTMs configured" from an empty stored field: report the
resolved value and its origin.
ORIGIN IS PER CHANNEL, not per key: a channel with an empty stored mapping
inherits the account default whole, so a channel whose resolved mapping differs
at all from that is stored on the campaign and every one of its values is an
override. The per-key `same_as_default` flag says whether that one key happens
to match the default anyway.
ORIGIN VALUES:
- campaign_override: stored on this campaign channel, differs from what it would inherit.
- account_default: inherited from this account's UTM defaults.
- platform_default: inherited from the Metadata-wide default (account set nothing).
- not_set: the channel really has no UTM mapping (non-sponsored channels only).
HONEST LIMIT: a campaign that stores a mapping identical to the default it
would inherit is reported as inherited. The platform returns resolved values
with no provenance, so that case cannot be distinguished - say so rather than
claiming the campaign has no override.
INPUT:
- campaign_id: the WIZARD campaign id (from list_wizard_campaigns / search_campaigns_by_names).
- channel: the enabled channel to edit: LINKEDIN, FACEBOOK, INSTAGRAM, GOOGLE_ADS,
MICROSOFT_ADS or REDDIT. UTMs are stored per channel; call once per channel.
- utms: object of UTM key to value. Standard keys UTM_SOURCE, UTM_MEDIUM, UTM_TERM,
UTM_CAMPAIGN, UTM_CONTENT (utm_source style is accepted and normalised); other keys
are custom static parameters. A value is either literal text ("paid-social") or one
of the platform's dynamic tokens, substituted at serve time: AD_CHANNEL, AD_NAME,
CAMPAIGN_NAME, OFFER_TYPE, OFFER_FORM_NAME, AUDIENCE_NAME_OR_KEYWORD, EXPERIMENT_ID,
EXPERIMENT_NAME, NATIVE_CHANNEL_CAMPAIGN_ID, NATIVE_CHANNEL_ADGROUP_ID,
NATIVE_CHANNEL_CREATIVE_ID, NATIVE_CHANNEL_KEYWORD, NATIVE_CHANNEL_SEARCH_TERM.
Keys you omit keep their current value; an empty string clears a key (the channel
then inherits that key's default again only if the whole mapping becomes empty).
`metadata_cid` is reserved and refused.
HOW IT WRITES: the platform endpoint replaces the campaign's whole UTM map and blanks
any enabled channel left out of it, so this tool reads the current mappings first and
re-sends every other enabled channel unchanged. A channel that was inheriting the
account default is re-sent with the same values it already resolves to, so tracking
does not change for it.
A Draft campaign carries the result into launch. On a launched campaign the mapping is
stored and reaches the ad platform with the next campaign publish (Microsoft Ads is
pushed live immediately). Verify with get_campaign_utms.
RESPONSE SHAPE:
{"success": true, "campaign_id": 173290, "channel": "LINKEDIN",
"applied": {"set": {"UTM_SOURCE": "Linkedin"}, "cleared": []},
"stored_mapping": {...}, "resolved": {...same shape as get_campaign_utms.channels.LINKEDIN...},
"notes": ["..."]}
Account-level UTM defaults are NOT edited here (get_account_utm_defaults is read-only).Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| utms | Yes | UTM key to value, e.g. {"UTM_SOURCE": "Linkedin", "UTM_MEDIUM": "paid-social", "UTM_CAMPAIGN": "DG_Touch-3_TAG", "UTM_CONTENT": "AD_NAME"}. Empty string clears a key. | |
| channel | Yes | The enabled channel whose UTM mapping to edit. | |
| campaign_id | Yes | Wizard campaign id (the `id` from list_wizard_campaigns). |