Cart and order events.
For your developer: how to get cart and order events into the denuo. tracker from WooCommerce, PrestaShop, Magento and custom or headless shops, with rules, the shop’s own data or a few lines of code.
Other help: Client support · Install the tracker · Privacy and GDPR · Technical questions · A/B tests · Platform help
Which events matter
On Shopify and WooCommerce the tracker reads the cart by itself. On any other platform the one line of code sees pages, clicks, scroll, forms, searches and popups, and the cart and orders only where the shop already sends them to a pixel or data layer, or where a rule is set. These events close the rest of that gap. Send them in this order of value:
| Event | What it unlocks in the platform |
|---|---|
| Purchase | Orders and revenue per traffic source, conversion rate, and the revenue behind every test and initiative. Without it the platform shows visits but no results. |
| Add to cart | The funnel from product page to cart, and which products are added but not bought. |
| Checkout started | The step between cart and order, so you can see where visitors drop. |
| View cart, remove from cart | Cart behaviour, and removal rates per product. |
| View item, view item list | Merchandising: which products and lists are seen, and how often they lead to an add to cart. |
If you can only do one thing, send the purchase. Add to cart comes second.
Method 0: no code, rules and automatic reading
Try this first. Two things need no work from your developer.
Tracking rules: in the platform, open Account → Tracking → Rules (or ask Miguel to set them). A rule says where a signal lives on your pages, and the script fetches it at load, so nothing changes on your site.
- Add to cart, remove, view cart, checkout started: the button to watch (a selector, see below), and where to read the product id, name, price and quantity.
- Checkout steps: the addresses of the contact, address, shipping and payment steps.
- Order confirmation page: its address, and where to read the order number, the total and the currency. This gives the purchase.
- Goals, page types and custom events: any address, click, form or block you want counted or named.
Automatic reading: if your shop already sends events to the Meta pixel, the TikTok pixel or Klaviyo, or has older Google Analytics (Universal Analytics) ecommerce data or an order in the page’s structured data (JSON-LD), the tracker reads them with no rule. The Tracking page shows which signals arrive and from which source, and for each missing one the fix: a rule, a data layer push or a direct call.
Use Method 1 or 2 below only for what the Tracking page still shows as not arriving.
How do I find a selector?
A selector is a short code that points to one button, form or piece of text on a page. To get it:
- Open the shop page in Chrome, Edge or Firefox.
- Right-click the button or text you want to track and choose Inspect.
- A panel opens with one line highlighted. Right-click that line.
- Choose Copy, then Copy selector.
- Paste it in the Selector box on the Rules tab.
A short selector such as .add-to-cart works best. If you are not sure, send the page address and what you want counted to hello@denuomarketing.comResources and it is set up for you.
Method 1: your data layer, usually no code
Many shops and plugins already push Google-style ecommerce events to window.dataLayer, or call gtag('event', …). The tracker reads both automatically, including events pushed before it loaded. It recognises these names: view_item, view_item_list, select_item, add_to_cart, remove_from_cart, view_cart, begin_checkout, add_shipping_info, add_payment_info and purchase.
Check whether your shop does this: open your shop, right-click → Inspect → Console, type dataLayer and press Enter. Open the list and add a product to the cart. If entries named add_to_cart appear with an ecommerce object, you are done with that event. Repeat on the order confirmation page and look for purchase.
If they are missing: look in your platform's analytics or Google Tag Manager settings for the Google Analytics 4 ecommerce events and switch them on. The setting is usually in the shop's analytics, tracking or tag manager integration. Google Tag Manager is not required for the tracker to read them, only for the shop to send them. Send Miguel your platform and version if you cannot find it, and he checks what it supports.
For purchase the tracker reads transaction_id (or order_id), value, currency, tax, shipping, coupon and discount. For each product it reads up to 20 items with these fields:
| Field in the data layer | Meaning |
|---|---|
item_id | Product id or SKU |
item_name | Product name |
price, quantity | Unit price and number of units |
item_variant, item_brand, item_category | Variant, brand and category, if you have them |
A push that works looks like this:
Method 2: direct calls
If the shop does not push these events, call the tracker yourself. Start every script with the queue line, so the calls work even when they run before the tracker has loaded:
The command is denuo('ecommerce', 'EVENT', {…}). The events are ADD_TO_CART, REMOVE_FROM_CART, VIEW_CART, CHECKOUT_STARTED and PURCHASE. Other names, such as VIEW_ITEM, are recorded as written. The fields below are the ones the tracker keeps:
- Cart events:
items(a list of products),valueandcurrency. Each product can carryproductId,name,price,quantity,variant,brand,categoryandsku. - Purchase:
orderId,revenue,currency,subtotal,discount,shipping,tax,codes(a list of discount codes) andproducts(the same product fields as above). Useproductshere, notitems. - No double counting: a purchase is recorded once per
orderId. If the confirmation page is reloaded, the second call is ignored, and for visitors who accepted analytics the last 20 order ids are also remembered in the browser. Without anorderIdthe page view is the only guard, so always send it. - Goal alternative:
denuo('goal', 'purchase', {…})records the same order, but with no check against repeats. Useecommerceunless your shop cannot.
Examples
Each example is a template. The capitals are placeholders for your shop's own values; nothing here is real data.
Example: add to cart button
Put this in the code that runs after a product is added.
Example: remove link in the cart
Example: order confirmation page
Add it to the confirmation template only, with your platform's order variables in place of the capitals.
Example: reacting to your platform's own cart event
Most platforms and plugins fire a browser event or a hook when the cart changes. This shows the shape; your developer maps the real event and fields.
Rules for the data
- No personal data: never send names, emails, phone numbers or addresses, in items, order fields or labels. The tracker removes emails and phone numbers it recognises, but it cannot recognise a name.
- Amounts as plain numbers in the shop currency, in units:
19.90means 19.90 in the shop's currency, not 1990 cents. This applies tovalue,price,revenue,subtotal,discount,shippingandtax. Send numbers, not text like"19,90 EUR". The collector drops a negative or implausibly large amount and keeps the rest of the event. - Currency: a 3-letter code such as
EURorGBP, the one the shop charged in. Anything else is dropped. - Size: up to 50 products per direct call, 20 per data layer event.
- Consent: these calls follow the same consent rules as every other event, set up in the cookie banner.
WooCommerce order messages
WooCommerce can send each order to the collector as a signed message (a webhook). It gives exact revenue, including visitors who declined cookies, plus refunds, cancellations and first versus repeat orders. Only order figures, products, discount codes and hashed customer and email values are kept; names, addresses, phone numbers and notes are discarded.
- Ask Miguel from the Tracking page (or by email). He enables it for your site and sends you the secret.
- In WordPress, open WooCommerce → Settings → Advanced → Webhooks → Add webhook.
- Create three webhooks, with topics Order created, Order updated and Order deleted, status Active.
- Delivery URL:
https://t.denuomarketing.com/webhook/woocommerce?site=YOUR_ID. Secret: the one Miguel sent. Save.
Each message is checked against the secret, and one that doesn’t match is rejected. The first delivery after saving is a test message and is not stored. Place a test order and tell Miguel; he confirms it arrived.
What the tracker cannot see on your platform
| What | With only the one line | With this page done |
|---|---|---|
| Pages, clicks, scroll, forms, search, popups | Seen | Seen |
| Add to cart | WooCommerce: button clicks and the product form, with product id and quantity but no price. Other platforms: seen only if the shop sends it to a pixel or data layer | Seen, with prices |
| Remove from cart, view cart, checkout started | Seen only if the shop sends it to a pixel or data layer | Seen |
| Orders and revenue | Seen only if the shop sends it to a pixel or data layer, or the order page has structured data | Seen, once per order id. Exact with order messages |
| Refunds and cancellations | Not seen | Seen with order messages (Shopify or WooCommerce). Not seen without them |
| Abandoned checkouts | Not seen | Shopify only (checkout notifications). Elsewhere only the start of checkout is known |
| First versus repeat orders | Not seen | Seen with order messages (Shopify or WooCommerce). Not seen without them |
Revenue figures from a browser event can miss an order if the visitor closes the tab before the confirmation page loads, so expect them to differ slightly from your shop's own reports.
Testing
- Open your shop, right-click → Inspect → Network, and type
denuoin the filter. - Add a product to the cart. A few seconds later a request to
t.denuomarketing.com/eshould appear and answer200. Open it and look in the Payload tab forECOMMERCEandADD_TO_CART, with your product's id, name, price and quantity. - Place a test order, then check the request. It should contain a
CONVERSIONevent withgoalIdset topurchase, your order id, the total and the currency. Reload the confirmation page: no second purchase should be sent. - Type the line below in the Console to see the consent state and the cart the tracker has seen.
A 403 answer means the page's domain is not on your list. A missing price or revenue usually means the value was sent as text, or in cents.
Send Miguel: the site id, the address of the product and confirmation pages you tested, the order id of the test order, and a screenshot of the Payload tab for the purchase request.
Questions
Email Miguel at hello@denuomarketing.com with your site id (it is in your tracker code after ?site=) and your platform. Miguel replies within 2 business days.