PixelMili

Install the tracking script

PixelMili's entire frontend footprint is a single async <script> tag. It's under 10 KB gzipped, loads after the page, and never blocks render.

The snippet

Add this once, ideally just before </head>:

layout.html
<script async src="https://track.pixelmili.com/t.js"
        data-tracking-id="pm_YOUR_TRACKING_ID"></script>

What the script does

  • Registers the pm() global function for custom events.
  • Auto-fires a PageView on every page load.
  • Captures _fbp, _fbc, UTM parameters, and referrer.
  • Sends to track.pixelmili.com/collect (or your custom CNAME).

Firing custom events

After the script has loaded, call pm() with an event name and any extra data:

js
pm('track', 'AddToCart', {
    value: 1299,
    currency: 'BDT',
    content_ids: ['SKU-123'],
    content_type: 'product',
});

pm('track', 'Purchase', {
    value: 4299,
    currency: 'BDT',
    content_ids: ['SKU-123', 'SKU-456'],
    num_items: 2,
    order_id: 'ORD-2026-0042',
});

Where to put calls

The standard e-commerce events are detected automatically — most sites need no calls at all. Only fire one yourself if auto-detection misses it on your site.

EventAuto-detected from
PageViewEvery page load.
ViewContentProduct page (URL, og:type, or Product schema).
AddToCartClick on an add-to-cart / buy-now button.
InitiateCheckoutCheckout page load.
PurchaseThank-you page (see below to set it exactly).

Already have a Meta Pixel on your site?

PixelMili already sends every event to Meta server-side. If your site also runs its own Meta Pixel, those browser events carry a different event ID — Meta can't tell they're the same action and counts both. Pick one:

  1. Simplest: remove your Meta Pixel code. PixelMili's server-side events cover everything it was sending.
  2. Keep the pixel (browser + server, as Meta recommends): add data-meta-pixel="mirror" to the PixelMili script, then in your pixel code delete fbq('track', 'PageView'); and any fbq('track', ...) calls for ViewContent, AddToCart, InitiateCheckout or Purchase. Keep fbq('init', ...). PixelMili then fires those events through your pixel with the same event ID it sends server-side, so Meta keeps exactly one.
layout.html
<script async src="https://track.pixelmili.com/t.js"
        data-tracking-id="pm_YOUR_TRACKING_ID"
        data-meta-pixel="mirror"></script>

Not sure which applies? Open your site with the browser console open — the script prints a warning if it finds a Meta Pixel it isn't mirroring.

Pointing Purchase at your exact thank-you page

On a custom site (no plugin, no order webhook), the script detects your thank-you/order-confirmation page automatically — it recognizes common URL patterns, page titles, and order schema markup. That heuristic works for most stores, but if your thank-you page has an unusual URL, tell the script exactly where it is with data-success-url. When set, it's the only thing that decides "is this the Purchase page" — the automatic detection is skipped entirely, so an unrelated page can never accidentally trigger a Purchase.

layout.html
<script async src="https://track.pixelmili.com/t.js"
        data-tracking-id="pm_YOUR_TRACKING_ID"
        data-success-url="/order-complete/*"></script>

Use * as a wildcard for anything that varies (an order ID, a transaction reference from your payment gateway, etc.) — it's matched against the page path only, not the full URL, and is tolerant of a trailing slash.

Reloading the thank-you page — or a customer navigating back to it later — never fires a duplicate Purchase. The script remembers which order it already sent (using the order ID when it can find one, the page path otherwise) and won't fire the same one twice, no matter how many times the page reloads.

ESC

Full-text search is coming soon. Use the sidebar for now.