ecomcloser.com

Online checkout form on a laptop screen

Track a WooCommerce conversation from recommendation to purchase

To track chat-to-checkout analytics in WooCommerce, send a custom GA4 event such as chat_recommendation_view when a product recommendation appears in the conversation. Then use the store’s standard add_to_cart, begin_checkout and purchase events to measure what actually happens next. Send the cart event only when WooCommerce accepts the item, and give each confirmed purchase a stable transaction ID.

Keep the conversation itself out of GA4. Where your consent configuration permits, use a simple session-scoped exposure flag to distinguish eligible visits that saw a recommendation from eligible visits that did not. Compare their progression through cart, checkout and purchase, but keep the milestones distinct: a shopper can select an option by voice without adding it, and can start checkout without paying. That distinction makes the funnel useful for diagnosing where shoppers stop.

1. Define what each event proves

Start with the WooCommerce events you already send, not with a second funnel inside the chat integration. Inventory which component sends each ecommerce event: the theme, an analytics extension, another tracking integration or the chat interface. Then document the condition that makes each event true. The recommendation event is new; the ecommerce events should still describe the same store actions whether a shopper arrived from chat, a product page or somewhere else.

  • chat_recommendation_view: Send when the shopper is shown a recommendation card, not when the assistant merely generates a suggestion.
  • add_to_cart: Send after WooCommerce accepts the selected item and quantity. The request alone does not count.
  • begin_checkout: Send when the shopper reaches the configured checkout start. Use the same boundary across entry paths.
  • purchase: Send when the order meets the store’s defined purchase condition, with the stable transaction ID for that order.

Give each event one owner. That means one component decides when to emit the ecommerce event, even if several components know about the action. The chat interface can show a cart confirmation while the existing store integration records the add. If the existing integration does not observe cart changes made from chat, close that gap through the agreed event owner instead of letting both components send an event for the same change.

Write the event rules so someone can test them without interpreting intent. For add_to_cart, “shopper asked for it” is not testable against WooCommerce; “the cart accepted a one-unit increase for the selected variation” is. Note what should happen on rejection, retry and reload, and which WooCommerce state confirms the result. Also agree on the item ID convention before implementation. If adds identify variations but purchases identify only parent products, the session funnel can still work, but an item-level report cannot safely claim that the same variation progressed through it. Document that limitation rather than joining unlike IDs and assuming they match.

2. Record the recommendation shoppers actually see

Define exposure from the shopper’s side of the interface. A recommendation prepared in the background, queued behind an earlier answer or left inside a closed chat panel is not necessarily shown. Pick an observable point, such as a product card displayed in the open conversation. Use that same rule for typed and voice-led journeys. If a voice interface only reads a suggestion aloud and never displays a card, don’t count it as a card view: measure it separately if needed, and label the difference in reports.

Illustrative example: A conversation displays a card for a trail jacket. The shopper says “navy, medium,” and an illustrative preview shows that variation. The card display is the recommendation exposure. The spoken choice and the updated preview are selection steps, not cart actions. If the shopper accepts the selection, wait for WooCommerce to confirm that the navy, medium variation was added before recording add_to_cart. If it is unavailable, the recommendation can count even though no add took place.

Choose a repeat rule that reflects your reporting unit. One workable approach is to count each distinct card when first shown in a conversation, but not count the same card again when the panel reopens or the layout redraws. A genuinely new recommendation can qualify under that rule. Keep any identifiers needed just to recognize a redraw within the application rather than passing them to GA4. For a session comparison, the first qualifying exposure is enough to mark the visit; additional cards do not create additional exposed sessions.

Use a controlled catalog identifier if you need to report which product was recommended. A card may represent a parent product while the shopper chooses a variation later. Preserve what you actually know at each step: record the parent at exposure if no variation was shown, then use the accepted item in the ecommerce event. That lets you report recommendation-to-cart progression without pretending the original card specified a size or color.

3. Measure the accepted WooCommerce cart change

Use the WooCommerce cart result as the source of truth for an add. The Store API cart item response or the resulting cart state can tell your implementation what the store accepted. Don’t use the assistant’s confirmation text, a button click or an optimistic preview as evidence. A request can fail, a variation can become unavailable, or the cart can accept a different quantity than the quantity requested. Analytics should reflect the successful change, not the proposed one.

Agree on how the ecommerce integration represents an item, then apply that convention at cart, checkout and purchase. If you use variation IDs for individual sellable options, keep them consistent through all three events. Build the event from the accepted item and the quantity added. In GA4 ecommerce events, keep the item quantities and prices consistent with the event value as applicable, and include the currency when sending a monetary value. Don’t borrow a static price or currency from an earlier recommendation if it differs from the cart.

Illustrative example: A shopper already has one medium navy jacket in the cart and uses chat to add one more. WooCommerce updates the same line to quantity two. The add describes one extra unit, not two. If the interface retries after a slow response but the cart changes only once, there is still just one add to report. If the shopper later deliberately adds another unit and WooCommerce accepts it, that is a new action, even though the item ID is unchanged.

Check the failure path as carefully as the success path. For an unavailable variation, there should be no add_to_cart unless another item is subsequently chosen and accepted. If a request times out after reaching the store, reconcile with the cart before assuming nothing changed or submitting another add. And if a cart contains unrelated quantities that change independently, avoid attributing the entire difference to chat. Tie the event to the accepted action your integration can actually confirm.

4. Set a checkout boundary that works across entry paths

Pick one observable definition of checkout start and use it for visits with and without a recommendation. For example, the store might define it as the shopper reaching the first actual checkout step with a populated cart. A chat button labelled “Checkout” is not enough: it records an attempt to proceed, not arrival. If your store uses a checkout flow that does not begin on a separate page, identify the equivalent milestone in that flow and test it explicitly.

Build the begin_checkout event from the full checkout basket at that boundary, not just from the last recommendation. A shopper might accept one item from chat, remove a second item, and add a third while browsing. The checkout event should describe what they are taking into checkout. If you need to know whether a recommended product remained in the basket, answer that with a separate item-level comparison. A session exposure flag describes the visit; it does not identify the origin of every cart line.

Decide which transitions count as a new checkout attempt before collecting data. Repainting a checkout component, refreshing the page, returning from a validation error or moving to the next form step should not automatically produce another start. If your store deliberately treats a later re-entry as a new attempt, write down the condition and apply it to both comparison groups. For the session funnel, count sessions that reach checkout rather than using the raw start count as a proxy for shoppers.

Test routes that bypass your expected cart page. A shopper may go from a confirmed add directly to checkout, or begin checkout with items that were already in the cart before opening chat. Both can produce valid store events. The second route might contribute to a comparison of exposed sessions, but it does not demonstrate a recommendation-to-add path. Retain this distinction instead of inserting a missing add so the sequence looks complete. A checkout start records neither order confirmation nor payment.

5. Anchor purchase to order state, not to the chat or page

Agree with the store team on which order state qualifies for purchase. Document how that rule applies to immediate payment, payment that is confirmed later and any checkout flow your store intentionally treats as a purchase before settlement. An order record can exist before payment succeeds, and a confirmation page can be revisited. If your reporting question is specifically about paid orders, verify payment under the store’s rules rather than treating an order reference or thank-you screen as proof of payment.

Use the same stable, non-personal transaction ID whenever the same qualifying order is reported. Do not generate a new ID from a page load, payment retry or chat session. Distinct orders need distinct IDs, so check for collisions if more than one storefront sends to the same analytics property. GA4 uses transaction IDs to deduplicate purchase events; a consistent ID is a safeguard, not a reason to deliberately emit the same event from several places.

Build the purchase details from the final order, including its items, quantities and currency, using the same item identifiers as earlier ecommerce steps. Follow the GA4 ecommerce convention for value: use the sum of item price times quantity, excluding shipping and tax, and report shipping and tax separately when applicable. That distinction matters during reconciliation. Comparing analytics item value with the amount charged, without recognizing how each figure is composed, can make a valid purchase look wrong.

Illustrative example: A shopper selects a mug by voice, the cart accepts it, and checkout creates an order while the payment outcome is pending. Those are three different states. If the store’s purchase rule requires confirmed payment, wait for that confirmation. A failed payment followed by a successful retry on the same order should not create two purchases. If confirmation arrives after the original visit and cannot be associated with it under your measurement setup, keep the purchase in order reporting and disclose the limit in the session funnel.

6. Prevent duplicates before GA4 receives them

De-duplication starts by tracing every way an event can be sent. Watch a successful add from chat and check whether the chat interface, theme and analytics extension each react to it. Two senders may use the same event name, item and quantity, yet still report one cart mutation twice. Remove the duplicate sender or route both interfaces through the same tracking decision. Do not assume the purchase transaction ID mechanism will deduplicate cart events.

Use a de-duplication rule specific to the action. For recommendations, distinguish a newly shown card from a redraw. For the cart, associate the send decision with the accepted change, not with the product ID, so a later intentional add of the same variation still counts. For checkout, associate the event with the start condition for the defined attempt, rather than every render of the form. Keep internal action references within the implementation when analytics does not need them.

For purchase, combine one event owner with a stable transaction ID. If both a browser confirmation page and an order-state integration can observe the same qualifying order, specify which one sends the event. If you have a fallback, define how it knows whether the primary path already handled that order. Check that a confirmation refresh cannot generate a second logical purchase and that any retry uses the original transaction ID. A fresh ID for the same order would defeat ID-based de-duplication.

Don’t try to solve duplicates by suppressing every event that repeats within a fixed number of seconds. A shopper can accept two separate adds quickly, while a confirmation page can be reopened much later. Timing alone cannot distinguish either pair. Verify the rules in both directions: deliberately repeat the interface action without changing store state, and then legitimately perform a new store action. The first should not inflate the count; the second should remain measurable. This catches implementations that appear clean in a single happy-path test only because they drop real repeats too.

7. Compare sessions without sending conversation content

Ask for the smallest piece of context the comparison needs: whether an eligible visit saw a qualifying recommendation. Where your consent configuration allows it, set a bounded marker at the first qualifying exposure, keep it scoped to the measured visit and carry it through the relevant ecommerce steps as needed. It can be as simple as an approved yes-or-no value. Don’t let it follow the shopper into a later visit just because the conversation panel remembers an earlier exchange.

Leave transcripts, prompts, replies, audio, transcribed voice selections, names, contact details and free-text notes out of event parameters. Use controlled values for any reporting labels and catalog IDs for products. Avoid attaching a chat thread ID merely because it would make joining records easier; the session comparison does not need one. Inspect the actual analytics payload, including fields your integration populates automatically. A clean custom parameter does not help if a page location or item label contains conversation text.

Define the denominator before drawing any conclusions. Exposed means you observed a qualifying recommendation in a visit eligible for the comparison. Unexposed means the visit was eligible and observable under the same rules, and no such recommendation was observed. If consent, missing context or collection gaps prevent that determination, do not silently put the visit in the unexposed group. Treat unknown exposure separately where measurable, and leave visits you cannot observe out of the comparison.

Preserve the order of events. A cart action that happened before the first recommendation did not follow that recommendation, even if the session is ultimately classed as exposed. Use the event sequence for the recommendation-led funnel, and describe the exposed-versus-unexposed comparison as a session-level view. If a late purchase has no reliable visit context, report it as a purchase without assigning it to one of those cohorts. Otherwise, filling in gaps based on what seems likely can make a report look complete while changing the question it answers.

8. Verify one variation and one order end to end

Run a test with a specific product variation and a known quantity. Start with an empty cart so the expected change is obvious. Open the conversation, display the recommendation, select the variation, accept the add, begin checkout and complete the test order. If voice selection is part of the flow, pause after speaking but before acceptance. You should see the recommendation event, but no cart event based solely on the voice selection or illustrative preview.

  1. Display and reopen the chat. Check that the card qualifies once under your exposure rule and reopening the panel does not create another view.
  2. Add the variation. Compare the item ID and quantity in the analytics event with the single accepted WooCommerce cart change. Check that both theme and chat are not sending it.
  3. Enter checkout. Verify the full basket and check that re-rendering the checkout does not create another start.
  4. Confirm the order. Check the order state, items, currency and transaction ID against WooCommerce. Refresh the confirmation page and verify that no extra purchase is sent, or that any repeat uses the same transaction ID.

Check both what the implementation sends and what Analytics reports. A purchase total of one does not by itself prove your implementation sent only one event: de-duplication can keep the reported count clean while two senders are still active. Likewise, one event in a test view is not proof of a successful add. The WooCommerce cart and order records tell you whether the events describe the state changes you intended to measure.

Then repeat the test with deliberate variations: reject an unavailable item, merge a new unit into an existing line, retry a payment, and run an equivalent checkout without chat. Include a visit where the exposure comparison is not permitted or cannot be established, and check that it is not labelled unexposed. Record the expected result beside the observed one. This gives you a concrete regression check after changes to the theme, checkout or analytics integration.

9. Read the funnel without giving chat credit for every order

Use two views to answer two different questions. The first is a recommendation-led sequence: of eligible sessions with a recommendation, how many subsequently recorded an accepted add, then reached checkout, then recorded a qualifying purchase in the same measured visit? State the window and ordering rules. If you require the recommended item to progress, also state the product matching rule, especially when the card shows a parent product and WooCommerce records a variation.

The second view compares eligible exposed and unexposed sessions using the same outcome definitions. Show the number of sessions in each group and the share that reached cart, checkout and purchase. Use session counts for reach and distinct transaction IDs for order counts; one session can contain several cart actions or, in some cases, more than one order. Avoid dividing purchase events by recommendation cards and calling the result a session conversion rate. Those two counts represent different units.

Use differences between stages to decide what to inspect next. A low share of accepted adds after recommendations warrants checking variation availability, selection clarity and whether valid cart changes are being recorded. A sharp decline from add to checkout makes the handoff worth testing, including direct checkout routes. If checkout starts look healthy but purchases are missing, reconcile analytics with WooCommerce before diagnosing shopper behavior. A payment still pending, a late confirmation and a missing purchase event are not the same problem.

Finally, treat the session comparison as descriptive. Shoppers who open chat or receive a recommendation may already differ in intent from shoppers who do not. An exposed visit can purchase something that was never recommended, and a visit that follows the whole sequence still does not show that chat caused the order. Report what you observed, name what you could not match, and choose the next test from the stage where the evidence is strongest. That makes the report useful for improving the store without turning exposure into an unsupported claim of sales credit.

Try the EcomCloser demo

Related guides

Sources