MMetadata /docs
Docs/Tools/search_campaigns_by_utm_value

search_campaigns_by_utm_value

Find campaigns whose UTM tracking parameters CONTAIN a given value - the only correct way to answer "which campaigns use / still say X in their UTMs".

Read campaigns

Returns data. Calling it changes nothing, so it is safe in an unattended loop.

What it does

Find campaigns whose UTM tracking parameters CONTAIN a given value - the only correct way to answer "which campaigns use / still say X in their UTMs".

                KEYWORDS: utm, utms, utm_source, utm_medium, utm_campaign, utm_term, utm_content, tracking parameters, search utm, find utm, placeholder, UPDATE ME, audit

                USE THIS TOOL WHEN THE USER ASKS:
                - "Which campaigns still have UPDATE ME in their UTMs?"
                - "Which campaigns tag utm_source as <something>?"
                - Any audit of UTM VALUES across campaigns.

                CRITICAL - DO NOT ANSWER THIS FROM CAMPAIGN NAMES. Campaign names, experiment
                names and tags do not contain UTM values. Searching them returns nothing and
                produces a confident WRONG "no campaigns found" - the exact failure this tool
                was built to end. If this tool errors or is unavailable, say you cannot check
                rather than falling back to a name search.

                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.

                TRACKING TIMING AND TOKEN MEANING:
Leads using server-resolved campaign UTMs use the current saved mapping when the platform processes them, without waiting for an ad republish. Captured URL or caller-supplied values can follow a different ingestion path, so do not generalize this timing to every new lead. Native click-time macros retain values captured from the lead's click URL.
Ad click URLs have a separate publication timeline: a draft uses the saved mapping at launch, and launched ads use it on their next campaign publish. Saving a launched Microsoft Ads campaign triggers a live UTM push.
AD_NAME is a dynamic token, not necessarily an individual ad name: standard experiments use their ad group name when present, otherwise their creative name; native ad structures use the native ad's own name. CAMPAIGN_NAME uses the wizard campaign name.
Saving a launched campaign can also queue an asynchronous existing-lead UTM refresh. Do not assume historical rows are immutable or that all old rows have already refreshed. Verify the saved mapping with get_campaign_utms and actual lead values and ingestion timing separately from live ad click URLs; a supplied or backfilled lead creation date alone does not prove when its UTMs were resolved.

                The match is a case-insensitive SUBSTRING over each enabled channel's EFFECTIVE
                (post-inheritance) UTM value, so a campaign that inherits a matching account
                default is returned too - which is correct, that is what it actually tracks with.
                It matches VALUES, not keys: searching "utm_source" finds nothing.

                MINIMUM 3 CHARACTERS. A shorter value is refused rather than sent, because the
                platform ignores a sub-minimum filter and would return the whole campaign list,
                which reads as "everything matches".

                Optional filters mirror list_wizard_campaigns: page, size, sort_by, sort_order,
                status (Draft, Launched, Finished), experiment_statuses, visibility, name.

                RESPONSE SHAPE: same as list_wizard_campaigns -
                {"totalElements": 20, "totalPages": 1, "data": [{"id": 173290, "name": "...", "status": "Launched", ...}]}

                The rows do NOT include the matching UTM value. To show WHICH parameter matched,
                call get_campaign_utms on the campaigns returned.

                Page through until the returned rows cover totalElements before reporting a count.

                READ-ONLY, current account only.

Arguments

ArgumentTypeNotes
utm_value string required Case-insensitive substring to look for in the campaigns' effective UTM values (e.g. 'UPDATE ME'). Minimum 3 characters.
page integer 0-based page index. Default: 0
size integer Results per page. Default: 25
sort_by string Field to sort by. Default: createdDate
one of: createdDate, startDate, endDate, name, budget, spent, leads, cpl, cpc, ctr, impressions, clicks
sort_order string Sort order. Default: desc
one of: asc, desc
status string Campaign-level status filter. Comma-separated subset of Draft, Launched, Finished. Omit to include all three.
experiment_statuses string Experiment-level status filter. Comma-separated subset of Active, WithoutSpend, Paused, Completed, Failed. Omit to include all five.
visibility string Optional: filter by campaign visibility. Omit to include all.
one of: VISIBLE, ARCHIVED
name string Optional: additional server-side campaign name substring filter.

Request

Request template, not a complete runnable example. Replace placeholders, empty objects, arrays, and zero values with valid account-specific inputs. Read required fields and nested constraints in the full schema. Confirm the account, connected channels, and referenced assets before calling a write tool.

curl
curl -s -X POST https://mcp-server.metadata.io/mcp \
  -H "Authorization: $METADATA_PAT" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "MCP-Protocol-Version: 2025-11-25" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"search_campaigns_by_utm_value","arguments":{"utm_value":"<utm_value>"}}}'

Response

No recorded response. This tool needs arguments that only exist inside an account, so no response is recorded here. The request is an illustrative template. Fill required fields and check the current schema before calling it. No response is fabricated.

Other campaigns tools:

Browse the tool catalog · machine-readable index