POST /api/checkout/start accepts a tracking object. UnderPass stores it with the order and
uses it for two things: campaign attribution in the organizer’s reports, and server-side
matching of the conversion on Meta (Conversions API) and TikTok (Events API). Everything in it
is optional; send what you have.
Capture rules
- First touch wins. Read
utm_*,gclid,fbclid,ttclid,document.referrerand the full landing URL on the buyer’s first page view of the session, store them (a cookie orsessionStorage), and keep them even if a later page carries different parameters. A mid-session UTM must not hijack the attribution. ttclidarrives as?ttclid=on TikTok ad clicks. Keep it 30 days (TikTok’s attribution window).ttpis the value of the_ttpcookie the TikTok pixel sets; read it at submit.fbc/fbpare the Meta cookies (_fbc,_fbp); read them at submit. If you have anfbclidbut no_fbccookie, build it asfb.1.<timestamp ms>.<fbclid>.channelis your derived bucket (paid_social,organic_search,direct, …). Optional; UnderPass derives one too when it is missing.client_ip_addressshould be the buyer’s real IP. If your storefront calls the API from a server, forward the IP from your edge (cf-connecting-ip,x-real-ip, or the firstx-forwarded-forhop). Private or loopback addresses are worse than none.client_user_agentisnavigator.userAgent, or the request header when called server-side.
Why it matters
The same order fires a browser pixel event and a server-side event on both ad platforms, deduplicated by the order id (see Analytics pixels). The server-side event can only be matched to the ad click throughfbc / fbp / ttclid / ttp, the IP and
the user agent. Orders without them still count in your reports, but the ad platform may not
credit the campaign.
