Skip to content
Peekbird

Purchases

Send each order once, when it's placed. Experiments then report revenue, conversion rate and average order value per variation, and recordings show who bought, what they paid, and the moment they did.

// On your order confirmation page, once the order is placed:
window.peekbird = window.peekbird || [];
peekbird.push(['track', 'purchase', {
  revenue: 49.90,        // the order total, as a number
  currency: 'USD',       // the three-letter currency code
  orderId: 'ORDER-123'   // your order number
}]);

The fields

revenue
The order total, as a number (49.90, not "$49.90"). Required: without it, the order is an event, not revenue.
currency
The three-letter code, like USD or EUR. Send the one the order was paid in.
orderId
Your order number. An order counts once even if the confirmation page is reloaded, and recordings can be searched by it.
anything else
Text, numbers or true/false, kept with the order (coupon, shipping method, …).

Shopify

Shopify runs no store scripts on its checkout, so orders come from a checkout pixel (the Shopify tab above):

  1. In Shopify admin, go to Settings → Customer events and click Add custom pixel. Name it Peekbird.
  2. Under Customer privacy, choose Analytics: it then runs for customers who allow analytics.
  3. Paste the code, then Save and Connect. Install & data in your dashboard has it with your site's ID filled in.

It links each order to the visitor the snippet saw on your store, so it counts for their experiments and recording. It sends the order total, with tax and shipping; for the subtotal instead, use checkout.subtotalPrice.

Google Tag Manager

  1. Variables → New → Data Layer Variable, three times: ecommerce.value, ecommerce.currency and ecommerce.transaction_id, named as in the code. These are the names of GA4's purchase event; if your data layer uses others, use those.
  2. Tags → New → Custom HTML with the code, fired by a Custom Event trigger named purchase.

Good to know

  • Send it from the confirmation page, not the checkout button: only placed orders should count.
  • It's sent at once, so it arrives even if the visitor closes the page right after.
  • The standard purchase goals (revenue, orders, order value) count it; add them to an experiment from your site's Goals.
  • With analytics off for a site, orders arrive only from visitors in an experiment. Leave it on (the default) to see everyone's orders in recordings.

See what your visitors see.

Start free in a few minutes: one snippet, every feature. Move to a bigger plan when you need more sessions.