TrueTrackedTrueTracked

Tracking Custom Websites & Checkouts

If you're building on a custom website or using a checkout platform that doesn't expose server webhooks (custom CMS, headless storefront, payment-link checkouts, custom funnels, etc.), you can still track purchases end-to-end by firing a single browser-side purchase event on your order confirmation page.

The event sends the order to TrueTracked and produces the same end result as a webhook integration: an entry in your orders table, server-side Meta CAPI / TikTok CAPI / GA4 Measurement Protocol fires, browser-side Meta Pixel / TikTok Pixel / GA4 / Google Ads conversion fires, identity stitching, and full attribution.

Already on Shopify or GoHighLevel? Use the dedicated webhook flows in the Integrations guide instead - those have native server-side order sources with richer data than the browser can provide.

Prerequisites

Before firing the purchase event, you need the TrueTracked base pixel installed on every page (including the order confirmation page). See the Pixel Installation guide for the base loader script. The purchase event uses the same SDK that powers your other tracking - no separate installation.

Quick example

On your order confirmation page (after a successful purchase), fire the event with the merchant's order details. This snippet works in any context where window.truetracked is loaded - directly in HTML, in a Custom HTML GTM tag, or inside your app code.

<script>
window.truetracked('track', 'purchase', {
  // Required
  transaction_id: 'ORDER-12345',
  value: 47.00,
  currency: 'USD',

  // Strongly recommended (Meta CAPI EMQ score)
  email: 'customer@example.com',
  phone: '+15551234567',
  first_name: 'Jane',
  last_name: 'Doe',
  shipping_country: 'US',
  shipping_postal_code: '90001',

  // Optional but useful
  sub_total: 39.00,
  tax: 4.00,
  shipping: 4.00,
  new_customer: true,
  items: [
    {
      item_id: 'sku-1',
      item_name: 'Widget',
      price: 39.00,
      quantity: 1,
      item_sku: 'sku-1'
    }
  ]
});
</script>

How it works

  1. Browser fires truetracked('track', 'purchase', {...})
  2. SDK auto-attaches the visitor's tt_user_id, tt_session_id, fingerprints, and page context - no need to pass those manually
  3. TrueTracked normalizes the payload, writes the order to your orders table, and runs identity stitching (so the order is linked to the visitor's journey)
  4. Server-side conversions (Meta CAPI, TikTok CAPI, GA4 MP) fire with the enriched order data - high match quality
  5. Browser-side pixels (Meta Pixel, GA4, TikTok Pixel, Google Ads) fire on the same event - using the same transaction_id for browser ↔ server deduplication

Required fields

These three fields are mandatory. The event will be dropped silently if transaction_id is missing or empty.

FieldTypeDescription
transaction_idstringUnique per order. Used as the deduplication key across browser pixel + server CAPI fires.
valuenumberTotal purchase amount including tax and shipping (the number you want to attribute to your ads).
currencystring3-letter ISO 4217 code (e.g. USD, EUR, GBP).

Recommended fields

Pass as many of these as your checkout exposes. Each field directly raises Meta's Event Match Quality (EMQ) score - the difference between EMQ ~3 (low) and ~8+ (high) is whether Meta can properly attribute the purchase to the visitor's ad-click.

FieldTypeDescription
emailstringCustomer email - the strongest single identity signal for CAPI matching.
phonestringE.164 format preferred (+15551234567).
first_name / last_namestringCustomer name - boosts EMQ even when email/phone are present.
itemsarrayArray of { item_id, item_name, price, quantity, item_sku }. Drives product-level attribution.
sub_totalnumberPre-tax, pre-shipping order amount.
taxnumberTax portion of the order total.
shippingnumberShipping cost charged to the customer.
shipping_countrystringCustomer country (e.g. US).
shipping_postal_codestringCustomer ZIP / postal code - strong CAPI matching signal.
new_customerbooleanIf you know whether this is a first-time customer, pass true / false. Otherwise omit and TrueTracked will look it up by email.

Optional fields

FieldTypeDescription
customer_idstringYour internal customer ID, if you have one.
external_idstringAny merchant-controlled session/cart token. The visitor's tt_user_id is already the primary identity for browser-fired events; this is for cross-device stitching scenarios.
couponstringDiscount code applied to the order.
discountnumberTotal discount amount applied.
shipping_country_codestring2-letter country code if different from shipping_country.
shipping_provincestringState or province.
shipping_citystringCity.
source_namestringFree-text channel label (e.g. website, mobile_app).
notestringFree-text note attached to the order.
processed_atstringISO 8601 timestamp. Defaults to the moment the event is received.

Google Tag Manager example

If your checkout already pushes order data to dataLayer, you can fire the purchase event from a Custom HTML tag triggered on the order confirmation page. Replace the data-layer variable references with your own.

<script>
window.truetracked('track', 'purchase', {
  transaction_id: '{{dlv - ecommerce.transaction_id}}',
  value: {{cjs - ecommerce.value (number)}},
  currency: '{{dlv - ecommerce.currency}}',
  email: '{{dlv - user_data.email}}',
  phone: '{{dlv - user_data.phone}}',
  first_name: '{{dlv - user_data.first_name}}',
  last_name: '{{dlv - user_data.last_name}}',
  shipping_country: '{{dlv - user_data.address.country}}',
  shipping_postal_code: '{{dlv - user_data.address.postal_code}}',
  sub_total: {{cjs - ecommerce.sub_total (number)}},
  tax: {{cjs - ecommerce.tax (number)}},
  shipping: {{cjs - ecommerce.shipping (number)}},
  items: {{cjs - ecommerce.items-TT}}
});
</script>

Trigger the tag on a Page View event scoped to your order confirmation URL (e.g. Page Path matches /thank-you). The TrueTracked base script must load on the same page; both can live in the same GTM container.

What fires for each platform

A single purchase event triggers all of the following automatically (assuming you have the platform configured under Integrations or TrueSignal):

PlatformBrowserServer
MetaPixel PurchaseCAPI Purchase + NewCustomerPurchase / ReturnCustomerPurchase
GA4gtag purchaseMeasurement Protocol purchase
TikTokPixel PurchaseEvents API Purchase
Google AdsConversion (via GA4 purchase) -

Deduplication

Browser pixels and server CAPI both fire for the same purchase. To prevent each platform from counting it twice, TrueTracked uses your transaction_id as the deduplication key:

  • Meta: browser eventID + server event_id = transaction_id
  • TikTok: browser event_id + server event_id = transaction_id
  • GA4: dedupes natively on transaction_id

As long as transaction_id is unique per order, each ad platform will count exactly one Purchase per fire - even if both browser and server fires reach them successfully.

Verifying it works

  1. DevTools Network tab - after firing a test purchase, look for these requests:
    • POST t.ttrkd.com/event (the TrueTracked event ingest)
    • POST facebook.com/tr with ev=Purchase (Meta Pixel)
    • GET t.ttrkd.com/g/collect?...&en=purchase (GA4 + Google Ads)
    • POST analytics.tiktok.com/... with ev=Purchase (TikTok Pixel)
  2. Meta Events Manager → Test Events - confirm a single Purchase event with eventID matching your transaction_id. The badge should show both "Browser" and "Server" merged.
  3. GA4 DebugView - should show one purchase event with the correct value, currency, and items.
  4. TikTok Events Manager - should show one Purchase event with matching event_id.
  5. TrueTracked dashboard - the order will appear in your orders list with platform custom within a few seconds.

Troubleshooting

  • Event fired but no order in dashboard - check that transaction_id is non-empty. Events without it are accepted but the order is dropped (you'll still see the event in your raw events log).
  • Order shows value: 0 - the value field arrived as undefined or empty string. Confirm your data-layer variable resolves to a number, not a string template like '{{order.total}}' that didn't render.
  • Same purchase appearing twice in Meta - different transaction_id values across browser fire and a parallel server webhook will both count. Pick one source (browser purchase event OR a webhook) - don't fire both for the same workspace.
  • Google Ads conversion not firing - Google Ads piggybacks on the GA4 purchase event. Make sure your Google Ads conversion is configured against your GA4 property in your Google Ads account, with the purchase event mapped to a conversion label.
  • Customer always shows as "new" - if you're not passing the new_customer field, TrueTracked checks the orders table by email. The first order for a given email is always classified as new. To override, pass new_customer: false explicitly.
  • Page refresh fires the event again - TrueTracked deduplicates browser purchase events on transaction_id, so a second fire with the same ID is dropped. No action needed.

Related guides

  • Pixel Installation - install the base script on every page (prerequisite).
  • Integrations - Shopify and GoHighLevel webhook setup if you have those platforms.
  • TrueSignal - connect your Meta CAPI, Google Ads, and TikTok server-side conversions.
  • Cost Settings - add product costs so the dashboard can calculate gross profit and ROAS for these orders.