Free tool / Campaign tracking
Meta Ads UTM Builder for Facebook and Instagram
Get the URL parameters to paste into Ads Manager and the matching values to enter in Google Analytics 4. If an Instagram click arrives as ig and GA4 expects instagram, the spend can import without matching the visit.
01 / Build your tracking
Build Meta ad URL parameters
Choose how Meta traffic should appear in GA4. Copy the parameters for Ads Manager, or add destination URLs to tag a batch. The builder works in your browser and doesn't change your ads.
Traffic source
Use the exact value your ads and GA4 should share.
Used only with one shared Meta source.
Tag destination URLs in bulk (optional)
Up to 200 URLs. Leave this empty if you only need the Ads Manager parameters.
Unrelated query parameters and fragments are kept. The original URLs and live ads are never edited.
Default publisher template shown below. Use the reference templates if JavaScript is unavailable.
Ads Manager → Tracking → URL parameters
GA4 source and medium settings
Facebook: fb · Instagram: ig · Audience Network: an · Messenger: msg · Threads: th · Medium: paid_social
Tagged destination URLs
Check a resolved landing URL
Checks the tags against the current settings. Only GA4 can confirm whether a visit or cost row actually matched.
02 / Prepare campaign spend
Convert a daily Meta Ads export to a GA4 cost CSV
Export campaign-level data from Ads Manager with a daily date breakdown. For separate publisher sources, include the publisher platform as well. This converter prepares a file for manual import; it doesn't connect to Meta or Google.
Use the source convention and medium chosen above. If your file already has utm_source and utm_medium, those values are preserved.
You can also paste CSV below. The converter reads the file on this device; it does not upload it.
No file processed. Start with the example to see the expected format.
GA4 file preview
In GA4, choose Admin → Data import → Campaign data and map the downloaded headers. Check for overlapping imports first. A valid file doesn’t prove that the spend matched any visits.
Reference templates and mixed historical tags
Reference / Preset conventions
How do you want Meta traffic to appear in GA4?
Choose the convention that fits your account. SparkTraffic shows the settings here; you apply them in Meta and Google. No ad account login is needed to use the builder.
Keep Facebook and Instagram separate
Use this if you want to compare spend by publisher. One template works across supported placements. Meta substitutes the publisher at click time.
Ads Manager · URL parameters
utm_source={{site_source_name}}&utm_medium=paid_social&utm_id={{campaign.id}}&utm_campaign={{campaign.name}}&utm_content={{ad.id}}
Select and copy the whole line, starting with utm_source. Don't include the destination URL or a question mark.
GA4 · Enter these exact values
Facebook · fb
Instagram · ig
Audience Network · an
Messenger · msg
Threads · th
Medium · paid_social
Resolved click · illustrative Instagram ad
https://example.com/sale?utm_source=ig&utm_medium=paid_social&utm_id=12001&utm_campaign=Winter&utm_content=43002
For this click, the campaign ID is 12001. The last value (43002) identifies the ad. Enter ig in GA4, not {{site_source_name}}.
Checks source and medium locally. It doesn't visit the URL, check campaign IDs or confirm that GA4 recorded the visit.
Group all paid Meta traffic under one source
Choose this if you report Meta as one paid source. Facebook and Instagram will share the same source / medium in GA4, so you won't be able to separate those publishers using that dimension.
Ads Manager · URL parameters
utm_source=meta&utm_medium=paid&utm_id={{campaign.id}}&utm_campaign={{campaign.name}}&utm_content={{ad.id}}
Select and copy the entire line. If you already use the same source and medium consistently, keep your exact spelling in both systems rather than changing it for this example.
GA4 · Enter these exact values
Facebook · meta
Instagram · meta
Audience Network · meta
Messenger · meta
Threads · meta
Medium · paid
Resolved click · illustrative Instagram ad
https://example.com/sale?utm_source=meta&utm_medium=paid&utm_id=12001&utm_campaign=Winter&utm_content=43002
Even on Instagram, the click carries meta. Use lowercase meta in all five GA4 platform fields; leaving four blank doesn't group those publishers.
Use a resolved URL. This checks the shared source and medium locally without visiting the URL or contacting GA4.
My old ads use different tags
If Facebook clicks arrived as both fb / cpc and facebook / paid, one native Facebook mapping can't match both. Changing today's ads won't change those old visits.
First check · actual source / medium
In GA4 Traffic acquisition, choose Session source / medium and check a date when the campaign ran. Compare those values with the landing URL from an ad. If each publisher has one source and they share one medium, keep them and enter those exact literals in the native connection.
If one publisher really has multiple pairs
Choose one convention for future clicks. For history, import daily campaign rows through CSV, Sheets or BigQuery using the values GA4 actually collected. Split spend only if your source data supports the split; never put the same total on both rows.
Manual CSV · illustrative header and one daily row
utm_id,utm_campaign,utm_source,utm_medium,date,impressions,clicks,cost,currency
12001,Winter,fb,cpc,2026-12-01,1000,25,80.00,USD
Map the headers when setting up a manual import. Use the campaign ID, an ISO date, and the actual currency. See Google's campaign data import schema before uploading.
03 / Apply your settings
Where to paste Facebook ad URL parameters
In Meta Ads Manager, open the ad itself, then find Tracking → URL parameters. Paste the selected string without a leading question mark. Keep the destination in the Website URL field. If both fields contain the same key, the Tracking value takes precedence.
Start with one ad and inspect the final landing URL. Keep unrelated parameters already used by your store or another partner. Editing a published ad can trigger review or restart learning. Meta doesn't support dynamic URL parameters for Instagram collection-format ads. For a newsletter or an organic social post, use the manual UTM link builder instead.
Connect Meta campaign costs in GA4
In your GA4 property, go to Admin → Data import → Create import source → Campaign data → Meta. You need Editor access or higher and access to the Meta business and ad account. Select the account, enter the source and medium shown by the builder, then review the field mappings.
Before you connect: Google attempts to import at least 24 months of history. Check for an existing cost feed for the same account and dates. Save any history you need to retain and resolve the overlap before switching, or you may count spend twice.
GA4 then brings in campaign cost, clicks and impressions daily. Allow up to 30 minutes for the import and up to 24 hours for the numbers to appear in reports. The ad account, source and medium can't be edited after setup, so compare them against a real landing URL first.
04 / Check the result
Why did GA4 import the cost but miss the visits?
Open Reports → Data Import → Campaign data import validation. Compare the date, source and medium first, followed by the campaign ID and name if you supplied them. In Traffic acquisition, check the actual Session source / medium. A default channel such as Paid Social is a different classification.
Joined
GA4 found both the campaign data and the collected Analytics data. Compare cost with Meta using the same date range and currency.
No Analytics data
The import contains the campaign row, but GA4 didn't find matching traffic. Inspect the resolved ad URL for a source such as ig versus instagram, missing tags, or a different medium.
No campaign data
GA4 collected traffic but found no matching imported row. Check the selected ad account, date, campaign ID and publisher mapping. Allow for the reporting delay.
Worked example, not account data: Suppose two campaign rows import for the same day. The $80 Facebook row joins; the $20 Instagram row shows No Analytics data. Both rows imported (100%). One of two matched (50%). The joined row accounts for $80 of $100 in spend (80%). These percentages answer different questions.
If a campaign was renamed, the name in Meta's dynamic URL parameter stays at its first-published value. Compare the collected name with the import and keep utm_id tied to the campaign ID. Don't use an ad ID as a campaign ID.
Provider references: Meta dynamic URL parameters · Connect Meta to Google Analytics · GA4 campaign validation report.