Meta Ads Campaign Tracking (UTM Setup)
PartialLeads shows spend, ROAS, and profit at campaign, ad-set, and ad level on the Meta Campaigns page (switch levels with the tabs; click a row to drill in). To tie a purchase back to the exact ad that earned it, we need the Meta IDs on the ad click — Facebook doesn’t send them to your site automatically. You add them once, per ad account, using Meta’s dynamic URL parameters.
Why this is needed
We pull your spend from Meta by campaign / ad-set / ad ID. We attribute your revenue from the click that drove each purchase. To join the two, the click has to carry those IDs. We read them from the landing URL’s query string: utm_id for the campaign (fallback utm_campaign), and utm_content + utm_term for the ad set and ad.
Until you tag your ads, Meta-attributed revenue lands in the “Unattributed to campaign / ad set / ad” rows instead of against a specific one.
The parameter string
Paste this into your Meta ad’s URL parameters field:
utm_id={{campaign.id}}&utm_source=facebook&utm_medium=paid&utm_campaign={{campaign.name}}&utm_content={{adset.id}}&utm_term={{ad.id}}What each part maps to:
utm_id={{campaign.id}}— the campaign ID.{{campaign.id}}is a Meta dynamic macro that expands to the numeric ID at click time; this is the stable key we join campaign spend and revenue on.utm_content={{adset.id}}andutm_term={{ad.id}}— the ad-set and ad IDs, which unlock ROAS at those two levels.utm_campaign={{campaign.name}}— a human-readable campaign fallback, used only ifutm_idis missing.utm_source=facebook&utm_medium=paid— required. These are what classify the click as Meta paid traffic, which the whole attribution depends on. Keep them exactly as written.
The ad-set/ad order doesn’t matter — if your existing ads already put the ad ID in utm_content and the ad-set ID in utm_term (the reverse of above), leave them; we auto-detect which numeric ID is the ad set and which is the ad by matching against your synced spend. The one thing that must be numeric is utm_id (the campaign ID) for campaign-level matching.
{{campaign.id}} / {{adset.id}} / {{ad.id}} / {{campaign.name}} are Meta’s dynamic-parameter macros. Confirm the exact names in Meta’s current “URL parameters” help if Meta has renamed them — the values we need are the numeric IDs.
Where to paste it in Meta
Open the ad
In Meta Ads Manager, open the campaign you want to track and edit an ad (URL parameters live at the ad level, not the campaign level).
Find URL parameters
In the ad’s editor, scroll to Tracking → URL parameters and click Build a URL parameter (or paste directly into the field).
Paste and publish
Paste the string above, save, and publish the ad. Repeat for every ad whose campaign you want to see ROAS for. Setting it at the ad level for each ad in a campaign is what tags that campaign’s clicks.
This applies to traffic after you publish the change. Past clicks can’t be re-tagged, so pre-existing revenue won’t move into campaign rows retroactively — only new clicks carry the campaign ID.
What changes in PartialLeads afterwards
Once tagged clicks start converting:
- Campaign, Ad Set, and Ad rows populate on the Meta Campaigns page — each shows spend next to its attributed revenue, with ROAS and profit. Use the tabs to switch level, or click a campaign to drill into its ad sets, then an ad set into its ads.
- The “Unattributed” rows shrink as revenue moves onto specific campaigns / ad sets / ads.
- Account-level ROAS (on the Revenue-by-Source view) is unaffected — it already works without tagging.
Troubleshooting
Still seeing everything in “Unattributed to campaign” after publishing?
- Give it time. Only clicks after you published carry the campaign ID, and those visitors have to come back and buy. Early on, most revenue is still from pre-tag clicks.
- Check your landing page keeps the query string. If your funnel or a redirect strips
?utm_id=…from the URL before our pixel reads it, the campaign ID never gets captured. Test by clicking your own live ad and confirmingutm_id=is still in the address bar on the landing page. - Watch for redirect chains. Link shorteners, “click here” interstitials, or app-store style redirects often drop query parameters. The landing page the pixel fires on must still have
utm_id. - Confirm the macro expanded. In the landing URL,
utm_idshould be a number (the campaign ID), not the literal text{{campaign.id}}. If you see the literal macro, the parameter was pasted somewhere Meta doesn’t expand macros.
Account-level ROAS works immediately with zero tagging — it compares total Meta spend to total Meta revenue. Campaign-level ROAS is the part that needs utm_id. If you only care about the top-line number, you’re already done.