Create UET tags and conversion goals programmatically via the Microsoft Advertising Campaign Management API
domain: learn.microsoft.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Authenticate with OAuth2 plus Authorization, CustomerAccountId, CustomerId, and DeveloperToken headers — all four are required, and a missing CustomerId/CustomerAccountId is a distinct failure mode from a bad OAuth token.
POST /CampaignManagement/v13/UetTags with up to 100 tag definitions per call, and capture the returned TrackingScript/TrackingNoScript to embed on your site.
Once the tag is live, create conversion goals with AddConversionGoals, referencing the UET tag's TagId — you must have the TagId first.
Choose the appropriate goal type: UrlGoal, EventGoal, DurationGoal, PagesViewedPerVisitGoal, AppInstallGoal, InStoreTransactionGoal, or OfflineConversionGoal.
Configure the conversion window (1 minute to 90 days), and if using view-through attribution, set the account-level IncludeViewThroughConversions property with a window of up to 30 days.
Test against the sandbox environment first, keeping in mind sandbox uses a shared universal developer token against fake data.
Known gotchas
This is a SOAP-based service surface with a REST/JSON wrapper over the same operations — most third-party client libraries assume SOAP, which can trip up REST-only tooling.
You must create the UET tag and capture its TagId before you can create a conversion goal referencing it; the two can't be done in a single call.
A sandbox integration that 'works' proves nothing about production behavior, since sandbox validates against fake data with a shared universal developer token, not your real account.
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?