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

TikTok Ads revenue tracking: see which campaign brings paying customers

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

TikTok Ads revenue tracking means joining each payment on your site to the TikTok ad click that brought the buyer. On TikTok that comes down to three things: macros in the destination URL that name the campaign, a visitor ID that survives TikTok’s in-app browser, and a checkout that carries that ID even when the buyer finishes in another browser. Virling then counts the click as Paid and shows the money it led to per campaign, next to the purchases Ads Manager reports.

Start free trial

Write the destination URL with TikTok macros

TikTok swaps a macro for the real value when someone clicks. A macro is written in capitals with two underscores on each side:

https://yourstore.com/products/vitamin-c-serum?utm_source=tiktok&utm_medium=paid_social&utm_campaign=__CAMPAIGN_NAME__&utm_content=__CID__

These are the macros on TikTok’s help page (source: TikTok, About UTM Parameters):

  • Campaign. __CAMPAIGN_NAME__ and __CAMPAIGN_ID__.
  • Ad group. __AID_NAME__ and __AID__.
  • Creative. __CID_NAME__ and __CID__.
  • Ad, in upgraded Smart+ campaigns. __ADID_V2_NAME__ and __ADID_V2__. TikTok notes that the macros change in that experience, so an older tag may not carry over.
  • Placement. __PLACEMENT__, such as TikTok or TikTok Pangle.

Virling groups reports by utm_campaign, so whatever you put there becomes the row name. A campaign name is easy to read; the ID is safer if you rename campaigns while they run. A macro with a typo is sent as plain text, so __CAMPAIGN_NAM__ shows up in your report exactly like that. The TikTok ads UTM builder ticks the macros for you and maps each to a UTM tag.

Ads Manager can also attach tags by itself. The Auto-attach option, reached through Edit under the ad preview button, adds TikTok as the source, “Paid” as the medium and a campaign ID and name (source: TikTok, How to add URL parameters). Virling reads Paid as a paid medium in any case. TikTok does not say how Auto-attach mixes with tags you type, so choose one per ad and check the preview URL before publishing.

The ttclid on the landing page

TikTok appends ttclid to the landing page URL when someone clicks an ad, and uses it to tie the click to a campaign (source: TikTok, About TikTok Click ID). Virling never stores the value and never uses it to choose a channel or a campaign. It looks at it in one case: a visit that ends up Direct, from a browser that does not name an app, is labelled a shared link when a ttclid is present. Leave it on the URL for TikTok’s own reporting; click IDs and UTM parameters explains why it cannot replace the tags.

Inside TikTok’s in-app browser

TikTok says its ad clicks often open the page inside its in-app browser rather than taking the viewer to an outside one, and that this can lead to underreporting in other analytics tools (source: TikTok, conversion discrepancies). The usual cause is a missing referrer. Virling handles it in this order:

  • Paid medium on the URL. paid_social, paidsocial, paid, cpc, ppc or paidsearch, in any case, makes the visit Paid, with or without a referrer.
  • tiktok.com referrer, no paid medium. Social, together with your unpaid videos, which TikTok revenue tracking covers.
  • No referrer, utm_source=tiktok. Social. An unknown source such as tiktok-ads is Referral.
  • Nothing at all. The user agent decides: musical_ly, BytedanceWebview or TikTok in it makes the visit Social from tiktok.com, and anything else is Direct.

So an ad tagged with a paid medium is Paid no matter how the in-app browser behaves. A hyphen breaks this: paid-social is not a paid medium. Snapchat’s in-app browser is not recognized from its user agent, so an untagged tap from a Snap is Direct; Snapchat revenue tracking covers tagging Stories and ads there. The full rules are in how channels are decided.

Why the checkout often opens in another browser

Buyers who land in TikTok’s browser do not always pay there. Wallets are one reason. Stripe’s docs say PayPal, Klarna and Amazon Pay are not supported in in-app webviews, and that Google Pay and Link work only when they can finish without opening a pop-up window (source: Stripe, Express Checkout Element). A buyer who wants one of those, or the card saved in their phone’s browser, taps the menu and opens the page outside TikTok.

That second browser has its own cookies, so it gets a new visitor ID. What happens next depends on where the switch happens:

  • On the checkout page. The ID is already in the checkout. The Virling script adds it to Stripe, Polar, Dodo Payments and LemonSqueezy links when they are clicked, and a checkout you create on your server should read the virling_vid cookie. The payment still goes to the TikTok visit.
  • On the landing page. The URL still holds your tags, so the new browser starts a fresh visit that is also Paid and in the same campaign.
  • On a later page. The tags are gone from the address. The new ID starts as Direct, and the payment goes by that browser’s own history, which is often just this Direct visit.

The fewer steps between the ad and the checkout link, the less this costs you. Pages that redirect must keep the query string; see UTM parameters lost after redirect. The per-provider fields are in link checkout to visits, and cross-device attribution covers buyers who return on a laptop.

Set it up

  1. Add the Virling script to the <head> of every page a TikTok ad can open.
  2. Connect your store or payment provider in Site settings. On Shopify and WooCommerce, a short snippet stores the visitor ID on the order.
  3. Tag every ad with a paid medium and a campaign macro, and keep the same style across ads.
  4. Tap one of your live ads in the TikTok app, open the page in your phone’s browser from the menu, and check that the tags are still in the address.

By default, Virling credits the full payment, minus refunds, to the most recent visit in the past 90 days that was not Direct (see the attribution model). Then click Paid in the Channels card and open the Campaign tab for visitors, revenue and revenue per visitor per campaign. The Time to pay card shows how long buyers take, which matters before you cut a young campaign.

For profit, enter your monthly ad spend under Monthly spend per channel in Site settings. The Profit by channel card uses that number for the Paid channel as a whole, which includes any other platform you tag as paid.

An example: four ad groups, one month

Example data, made up to show the method: an imaginary phone case store sells one $45 case and tags its TikTok ads with utm_campaign=__AID_NAME__, so each ad group is its own row. Spend is read from Ads Manager; orders, revenue and refunds come from the store, credited by Virling to each ad group.

Ad groupSpendOrdersRevenueRefundedRevenue after refundsROAS after refunds
Creator unboxing$70041$1,845$90 (2 orders)$1,7552.51
Product demo$50028$1,260$45 (1 order)$1,2152.43
Trending sound$65019$855$315 (7 orders)$5400.83
Customer review clips$40015$675$0$6751.69
All four$2,250103$4,635$450 (10 orders)$4,1851.86

Purchase events are sent when an order is placed, before anyone asks for their money back, so a conversion count built from them still includes all 10 refunded orders. Counted that way, the trending sound ad group made $855 on $650, a ROAS of 1.32; after the 7 refunds it returned $0.83 per dollar and lost money, while the other three ad groups kept almost all of theirs. Check the sums in the ROAS calculator, add the cost of each case in the POAS calculator to see profit, and tag every ad group the same way with the TikTok ads UTM builder.

Where TikTok and your payments disagree

  • Impression date. TikTok files a conversion under the time of the ad impression that led to it, and time zones can shift it again (source: TikTok, conversion discrepancies). Virling files a payment under the day it was paid.
  • View-through. An ad group has a click window and a view window, for example 7 days after a click and 1 day after a view, and the view window can be switched off (source: TikTok, attribution windows for an ad group). Someone who only watched never visits your site.
  • Matching. TikTok matches events with email, phone, IP, user agent and other signals, per the same discrepancies page. Virling matches a payment by the visitor ID in checkout, and takes refunds off.
  • One winner. Virling gives each payment to a single visit from any channel. A buyer who tapped a TikTok ad and later came from your newsletter is credited to the newsletter by default, while TikTok may still claim the sale.

Ads Manager is where you run and tune the ads; the payments tell you which campaigns earn their budget. Facebook and Instagram ads are covered in Meta Ads revenue tracking, video ads on YouTube in YouTube Ads revenue tracking, and creator links in influencer revenue tracking.

Troubleshooting TikTok ad revenue

  • The campaign row reads __CAMPAIGN_NAME__. TikTok did not recognise the macro. Check the capitals and the two underscores on each side.
  • TikTok clicks sit under Social. The URL has no paid medium, or it uses paid-social with a hyphen.
  • TikTok clicks sit under Direct. A redirect stripped the tags, or the buyer switched browsers after the landing page.
  • Two rows for one campaign. Auto-attach is on for some ads and typed tags on others, or some ads use the name and others the ID.
  • Payments are Unattributed. Checkout is not receiving the visitor ID.

Frequently asked questions

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

Put utm_source=tiktok, utm_medium=paid_social and utm_campaign=__CAMPAIGN_NAME__ in the destination URL, add the Virling script to your site and pass the visitor ID into checkout. Click Paid in the Channels card and open the Campaign tab to see revenue per campaign.

Which TikTok macros can I use in a destination URL?

TikTok documents __CAMPAIGN_NAME__ and __CAMPAIGN_ID__, __AID_NAME__ and __AID__ for the ad group, __CID_NAME__ and __CID__ for the creative, and __PLACEMENT__. Upgraded Smart+ campaigns add __ADID_V2_NAME__ and __ADID_V2__ for the ad.

Does Virling use the ttclid?

No. It does not store the ttclid or use it to pick a channel or campaign. It only checks whether one is present on a Direct visit from a browser that does not name an app, and labels that visit a shared link.

Why do TikTok buyers pay in a different browser?

Ad clicks often open in the TikTok in-app browser, and some wallets do not work there, so buyers open the page in their phone browser. If the visitor ID is already in the checkout, or the tags are still on the URL, the payment stays with the ad.

Why does TikTok report a different number of purchases than my payment provider?

TikTok counts purchase events it matches to its ads within its click and view windows, dated by the ad impression. Virling counts payments your provider recorded, dated by when they were paid, with refunds taken off.

Do I need to connect my TikTok ad account?

No. Virling uses the tags on your ads and the payments from your provider. If you want profit, type your monthly ad spend for the Paid channel in Site settings.

See which TikTok 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