virling Pricing Self-host Demo Changelog Agencies GitHub Start free trial
blog / 2026-11-24

Meta Ads revenue tracking: see which campaign brings paying customers

By Devendra Variya, co-founder of Virling. Published 2026-11-24, updated 2026-11-30.

Meta Ads revenue tracking means joining each payment on your site to the Facebook or Instagram ad click that brought the buyer. Meta gives you a URL parameters field with dynamic values for the campaign, ad set and ad. Fill it with a paid medium, keep the visitor ID alive through the Facebook and Instagram in-app browsers, and pass it into checkout. Virling then files the click under Paid and shows revenue per campaign from the payments your provider recorded, not from pixel events.

Start free trial

Fill the URL parameters field

In Ads Manager, the tags go in the ad’s URL parameters field, not in the website URL, so there is no question mark in front:

utm_source=facebook&utm_medium=paid_social&utm_campaign={{campaign.id}}&utm_term={{adset.id}}&utm_content={{ad.id}}

A value in double curly braces is a dynamic parameter that Meta replaces on each click. Meta’s developer docs list six (source: Meta, Use URL Tags for Tracking):

  • Campaign. {{campaign.id}} and {{campaign.name}}.
  • Ad set. {{adset.id}} and {{adset.name}}.
  • Ad. {{ad.id}} and {{ad.name}}.

The name parameters have a quirk. Meta stores the names in a snapshot when the object is first published and reads that snapshot afterwards, so a campaign renamed later keeps sending its old name. IDs never change, which is why the example uses them. Reports in Virling group by utm_campaign; the ad set and ad values are kept with each pageview.

The Facebook ads URL parameters builder writes this string with the parameters you pick and shows a preview of the landing URL. That Meta page lists no placement parameter, so the builder offers none.

An ad that runs on both Facebook and Instagram sends the same string from both apps. If the split matters to you, run separate campaigns per app, each with its own campaign ID.

fbclid and the _fbc cookie

Meta describes the click ID as a Meta-generated value passed with your site’s URL when someone clicks an ad on Facebook or Instagram, and says the Meta Pixel stores it in the _fbc browser cookie (source: Meta, fbp and fbc parameters). It arrives as fbclid. That cookie is for Meta’s own matching.

Virling neither stores the fbclid nor sets a cookie from it, and it never uses it to choose a channel. The landing URL fields it reads are utm_source, utm_medium, utm_campaign, utm_content, utm_term and ref. The one place a click ID matters: a visit that ends up Direct, in a browser that does not name an app, is labelled a shared link if the URL has an fbclid or an igshid. Keep the click ID for Meta and add the tags for yourself; click IDs vs UTM tags compares the two, and iOS Link Tracking Protection and UTM parameters covers browsers that strip click IDs.

The Facebook and Instagram in-app browsers

A tap on an ad inside Facebook, Messenger or Instagram usually opens the page in that app’s own browser, and the visit often arrives without a referrer. Virling’s rules for a Meta click:

  • Paid medium present. paid_social, paidsocial, paid, cpc, ppc or paidsearch, in any case, is Paid. This rule runs first, so it beats an instagram.com or facebook.com referrer and the app’s user agent.
  • A Facebook or Instagram referrer. Social, alongside your unpaid posts.
  • No referrer, a known source. facebook, fb, instagram or ig is Social. meta is not a known source, so it is Referral.
  • No referrer, no tags. The user agent decides. Instagram in it means Instagram; FBAN, FBAV or FB_IAB means Facebook, which covers Messenger too. Either way the visit is Social. Without those marks it is Direct.

A medium spelled paid-social, or cpm, is not on the paid list. Details are in how channels are decided.

The app browser also keeps its own cookie jar, apart from Safari or Chrome on the same phone. Someone who taps your ad in Instagram, leaves, and buys days later in Safari arrives with a second visitor ID, and the payment follows the ID that reached checkout. Cross-device attribution explains what can and cannot be joined, and Safari ITP and attribution covers how long Safari keeps the cookie. Snapchat’s browser keeps its own cookies the same way; see which Snaps and Stories bring sales.

Connect checkout

Put the Virling script in the <head> of every landing page, and make sure redirects keep the query string (UTM parameters lost after redirect). Then connect the payment provider. Hosted checkout links from Stripe, Polar, Dodo Payments and LemonSqueezy pick up the visitor ID when clicked on a page with the script. If your server creates the checkout, copy the virling_vid cookie into it, as shown in link checkout to visits.

With the default model, a payment, net of refunds, is credited in full to the last non-Direct visit within 90 days. A buyer who clicks an Instagram ad and returns by typing your address is still credited to the ad, as long as it is the same browser (the attribution model).

Read revenue per Meta campaign

Click Paid in the Channels card, then the Campaign tab. Each campaign ID is a row with visitors, revenue and revenue per visitor. If several platforms are tagged as paid, they share this view, so the campaign value is what tells Meta rows apart. From the Payments page you can open any payment and see the visits that led to it.

Profit needs one number from you: your monthly spend, typed under Monthly spend per channel in Site settings. The Profit by channel card applies it to the whole Paid channel. Virling does not connect to your Meta ad account.

An example: four campaigns, one month

Example data, made up to show the method: an imaginary invoicing app runs four Meta campaigns for a month. Spend and link clicks are read from Ads Manager; paying customers and revenue come from the payments Virling credited to each campaign, and ROAS is that revenue divided by spend.

CampaignSpendLink clicksPaying customersRevenueROAS from payments
Prospecting, video$1,2001,05014$2,9402.45
Retargeting, carousel$60038011$2,5304.22
Reels, optimized for link clicks$1,1003,9003$5700.52
Lookalike, single image$8007206$1,4001.75
All four$3,7006,05034$7,4402.01

In Ads Manager the Reels campaign looks like the winner: 3,900 of the 6,050 clicks at about $0.28 each, against $1.14 for the video. In payments it brought 3 customers and under 8% of the revenue, returning $0.52 for every dollar spent, while the retargeting campaign returned $4.22 on the smallest budget. Run your own figures through the ROAS calculator, and tag each campaign the same way with the Facebook ads URL parameters builder so every row is its own campaign ID.

Why Ads Manager shows more purchases

  • Pixel events, not payments. Meta’s Purchase event fires when a purchase is made or a checkout flow is completed, with a value your site sends (source: Meta Pixel reference). Virling counts the charge your provider recorded, minus refunds.
  • Views and engaged views. Meta’s attribution windows include options such as 7 days after a click, 1 day after a view and 1 day after an engaged view (source: Meta, Ads Action Stats). A view without a click leaves nothing on your site to credit.
  • Shared credit. Meta can count a sale that Virling gives to the email or search visit that came after the ad.
  • Blocked scripts. A buyer with an ad blocker can be missing from one count and present in the other.

For a store-side comparison, see why Meta Ads purchases do not match Shopify. Unpaid posts are covered in Facebook revenue tracking and Instagram revenue tracking; other ad platforms in TikTok Ads, Pinterest Ads and YouTube Ads revenue tracking.

Troubleshooting Meta ad revenue

  • A row reads {{campaign.id}}. The parameter is misspelled, or it was pasted into the website URL instead of the URL parameters field.
  • Old campaign names in reports. That is the name snapshot; switch to IDs or accept the first-published names.
  • Ad clicks counted as Social. The string has no paid medium. Open your ad preview and read the address bar.
  • Ad clicks counted as Direct. A redirect dropped the query string.
  • Revenue lands in Unattributed. The visitor ID never reached checkout.

Frequently asked questions

How do I see which Meta ad campaign brought a paying customer?

Paste utm_source=facebook&utm_medium=paid_social&utm_campaign={{campaign.id}} into the URL parameters field of your ads, add the Virling script and pass the visitor ID into checkout. Then click Paid in the Channels card and open the Campaign tab.

Which dynamic parameters does Meta document?

{{campaign.id}}, {{campaign.name}}, {{adset.id}}, {{adset.name}}, {{ad.id}} and {{ad.name}}. Name parameters send the name saved when the object was first published, so IDs are steadier.

Does Virling read the fbclid?

It does not store it or use it for the channel. It only checks whether an fbclid or igshid is on a Direct visit from a browser that does not name an app, and labels that visit a shared link. Leave the fbclid on for Meta.

How are clicks from the Facebook and Instagram in-app browsers counted?

With a paid utm_medium, they are Paid. Without one, a Facebook or Instagram referrer or source makes them Social, and with nothing at all the app name in the user agent decides. The in-app browser keeps its own cookies, so a buyer who later pays in another browser can have a second visitor ID.

Why does Meta report more purchases than my payment provider?

Meta counts pixel Purchase events within its attribution windows, which can include views without a click. Virling counts payments your provider recorded, minus refunds, each credited to one visit.

Does Virling connect to my Meta ad account?

No. It uses the tags on your ads and the payments from your provider. For profit, type your monthly spend for the Paid channel in Site settings.

See which Meta Ads campaign pays

Virling is open source under AGPL. Self-host it free, or use the hosted version with a 14-day free trial. It connects to Stripe, Paddle, Shopify, WooCommerce, Polar, LemonSqueezy, Dodo, Creem and RevenueCat.

Start free trial See the demo