Skip to content

AddToCart

Fires when a product is added to the cart. The dedup path differs between the classic cart and the blocks cart.

updated

Outline — facts still to be confirmed

This article is a structured outline. Its headings and scope are settled; the specific values, screens and steps are marked TODO(owner: verify) until they have been checked against the plugin itself. Blueprint §7 is explicit that no article may state plugin behaviour that has not been verified.

When it fires

TODO(owner: verify) — the exact trigger conditions in the shipped build, including any settings that suppress it.

Which side sends it

AddToCart has two dedup paths, depending on which cart your store uses.

  • Blocks cart (Store API). The browser injects a request header carrying the event ID into the Store API call; the server hook reads the same header. One ID, no extra round trip.
  • Classic cart. The server enqueues at add-time and passes the ID to the browser copy on the page the customer is redirected to, through the WooCommerce session.

The blocks path is covered by unit tests but has not been exercised by a real click-through on a live blocks cart. If you run a blocks cart, verify this event specifically before trusting the numbers.

Deduplication

Both copies of a dual-flow event carry the same event ID. Meta merges on event name plus event ID; TikTok’s key additionally includes the event source. See Processed vs Deduplicated.

Data sent

Every event carries a common set of context parameters: content name, event URL, page title, post type, post ID, user role and a plugin identifier. These are added centrally, so they are present on every event rather than only on Purchase.

Customer data is SHA-256 hashed on your server before it leaves. IP address, user agent and click identifiers are sent raw, because the platforms require them in that form.

TODO(owner: verify) — the per-event parameter table: which commerce fields (AddToCart specifically) are included, and their names on each platform.

Per-platform mapping

Platform Event name Notes
Meta TODO(owner: verify)
Google TODO(owner: verify)
TikTok TODO(owner: verify)

Verification status

TODO(owner: verify) — record whether this event has been confirmed end to end on a live store, and on which platforms. Blueprint §7 forbids documenting behaviour that has not been checked against the plugin.

Was this page helpful?