Track Purchase
The Purchase event fires the moment a visitor completes an order on your site — usually when they land on the “Thank you for your order” or order-confirmation page. This is the most important event Meta needs to optimize your ads, because it tells Smart Bidding which clicks lead to revenue.

1. Copy the snippet
Pick one of the two formats below — whichever matches how you build your site. They both end up the same way on Meta.
Option A — pbq (recommended)
Same syntax as Meta’s standard pixel. Works out of the box on any custom site.
<!-- Place inside the <body> of your order-confirmation /
thank-you page, AFTER the AdsPing script in <head>. -->
<script>
pbq('track', 'Purchase', {
content_ids: ['SKU-1043'],
content_type: 'product',
num_items: 1,
value: 24.90,
currency: 'USD',
order_id: 'ORDER-9381' // enables cross-channel dedup
});
</script>Option B — dataLayer
Use this if your site already pushes events to window.dataLayer (e.g. via Google Tag Manager). AdsPing reads the dataLayer automatically.
<!-- Place inside the <body> of your order-confirmation /
thank-you page, AFTER the AdsPing script in <head>. -->
<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'purchase',
ecommerce: {
transaction_id: 'ORDER-9381',
value: 24.90,
currency: 'USD',
items: [
{ item_id: 'SKU-1043', item_name: 'Acme Hydrating Serum', quantity: 1, price: 24.90 }
]
}
});
</script>2. Where to paste it
Paste it inside the <body> of your order-confirmation page (the page customers see after a successful order). It must run AFTER the AdsPing script you added in Step 2 — placing it anywhere in <body> guarantees that.

Use real values, not the examples.
- · value — the total amount the customer paid (number, no currency symbol).
- · currency — 3-letter ISO code:
USD,EUR,TRYetc. - · order_id / transaction_id — the unique order number from your system. Meta uses this to dedup, so make sure each real order has a unique value.
- · If your platform renders the page from a template, replace the example values with template variables (e.g.
{{ order.total }}).
3. Test it
Complete a real test order on your site (a free product, a coupon-discounted order, or whatever your platform allows). After you reach the thank-you page, open your AdsPing dashboard and look at Recent Events for this pixel. A new Purchase row should appear within 10 seconds with a green Success badge.

To verify on the Meta side as well, paste a Meta Test Event Code into your pipeline. See the verification guide for the exact steps.
✓ Purchase is now live.
Every completed order on your site will be forwarded to Meta via the Conversions API — including for visitors with ad blockers or on iOS Safari.