Docs menu · Custom website

Docs / COD Order Protection / Your store

COD Order Protection

Custom websites: the purchase event

What your thank-you page needs to push so PixelFly can hold the order and send it later.

On WooCommerce you do not need this page — the plugin pushes this event for you. This is for custom-built stores.

Push this on the thank-you page, once per order

dataLayer.push({ ecommerce: null });
dataLayer.push({
  event: 'purchase',
  eventId: 'purchase_1042',            // unique per order (Meta keeps one copy)
  payment_method: 'cod',               // or 'bkash', 'card', …
  ecommerce: {
    transaction_id: '1042', value: 1580, currency: 'BDT', shipping: 80,
    items: [{ item_id: '189', item_name: 'Cat Toy', price: 750, quantity: 2 }]
  },
  user_data: { email: 'a@b.com', phone_number: '01712345678', first_name: 'Rina', last_name: 'Begum' }
});

What each part does

FieldNeeded?Why
payment_methodRequiredDecides whether the order is held. See the rule below.
value and currencyRequiredWithout them a confirmed order cannot be sent, and waits as missing purchase data.
transaction_idStrongly advisedHow you confirm the order later. Without one it is held as NOID-… and can only be approved by hand.
eventIdStrongly advisedStops Meta counting the same purchase twice.
user_dataAdvisedEmail and phone are how Meta matches a confirmed order back to the person who saw your ad. Fewer fields, weaker matching.
itemsOptionalProduct-level reporting and catalogue matching.

What counts as a COD order

PixelFly treats the order as cash on delivery when payment_method is:

  • exactly cod;
  • anything containing cash_on_delivery or cash on delivery;
  • or missing entirely — held on the safe side, because an unknown payment method is more often COD than not.

Anything else is prepaid and fires at checkout as usual. If your prepaid orders are being held, this field is the first place to look.

Next

Place one prepaid and one COD test order and confirm the held one appears with its value, products and customer.

We use cookies to enhance your experience, analyze site traffic, and for marketing purposes. By continuing to use our site, you consent to our use of cookies. Learn more