# New e-commerce guides/references

**URL:** <https://community.piwik.pro/t/new-e-commerce-guides-references/2269>\
**Category:** Data collection and tags\
**Created:** [May 22, 2023, 7:13am UTC](https://community.piwik.pro/t/new-e-commerce-guides-references/2269 "2023-05-22T07:13:13Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexanderf](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@alexanderf](https://community.piwik.pro/u/alexanderf)\
**Post date:** [May 22, 2023, 7:13am UTC](https://community.piwik.pro/t/new-e-commerce-guides-references/2269/1 "2023-05-22T07:13:13Z")

</div>

Hey Piwik Pro team,

Version 17.2.0 just released and improved on the e-commerce module but I can’t seem to find any documentation related to this. Particularly the “Product detail view”.

Is there any updated documentation or reference materials anywhere?

Best,

---

<div class="post-metadata">

**Author:** ![anthonybartczak](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/anthonybartczak/32/2430_2.png) [@anthonybartczak](https://community.piwik.pro/u/anthonybartczak)\
**Post date:** [May 22, 2023, 8:54am UTC](https://community.piwik.pro/t/new-e-commerce-guides-references/2269/2 "2023-05-22T08:54:21Z")

</div>

Hi [alexanderf](https://community.piwik.pro/u/alexanderf)!

The 17.2.0 has not been released in the product yet. The updated documentation should be available a day after the release.

You can check the current product version in the menu section of Piwik PRO:

![obraz](https://europe1.discourse-cdn.com/flex005/uploads/piwikpro/original/2X/c/c7f03610f0ba560fd218999249157b9bdea2aeb5.png)

---

<div class="post-metadata">

**Author:** ![joao](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/joao/32/1820_2.png) [@joao](https://community.piwik.pro/u/joao)\
**Post date:** [May 23, 2023, 2:17pm UTC](https://community.piwik.pro/t/new-e-commerce-guides-references/2269/3 "2023-05-23T14:17:25Z")

</div>

After having read the documentation on the new e-commerce methods in v. 17.2, I am still a bit confused on how the new ecommerceCartUpdate() method should be used.

> The **ecommerceCartUpdate()** method tracks the initial state of the cart. It should be called each time a session starts and only once per session. Its purpose is to restore the state of a cart that was abandoned in a previous session.

What if the cart is empty, should we still call this function with no products when the session starts?

If we call this function with no products, will this not be treated as **Shopping stage = Abandoned cart**?

What if the user is initially logged out, should we call this function immediately after the user logs in?

Thank you for your clarifications.

---

<div class="post-metadata">

**Author:** ![anthonybartczak](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/anthonybartczak/32/2430_2.png) [@anthonybartczak](https://community.piwik.pro/u/anthonybartczak)\
**Post date:** [May 25, 2023, 10:24am UTC](https://community.piwik.pro/t/new-e-commerce-guides-references/2269/4 "2023-05-25T10:24:30Z")

</div>

Hi joao!

I can see that there are parts of the documentation that could be misleading without additional context. We will most likely update it soon 🙂.

> [@joao](#):
>
> What if the cart is empty, should we still call this function with no products when the session starts?

If the cart is empty there is no need to send the `ecommerceCartUpdate`. I’d even advise against using it that way (see 2nd answer).

> [@joao](#):
>
> If we call this function with no products, will this not be treated as **Shopping stage = Abandoned cart**?

The cart will be treated as an abandoned cart.

> [@joao](#):
>
> What if the user is initially logged out, should we call this function immediately after the user logs in?

For scenarios where shop cart is populated after user logs in I would send `ecommerceCartUpdate` immidiately after the user logs in. If user logs in and the cart stays empty then you should not send an empty `ecommerceCartUpdate`.

---

<div class="post-metadata">

**Author:** ![Thomas\_Anode\_FR](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/thomas_anode_fr/32/1425_2.png) [@Thomas\_Anode\_FR](https://community.piwik.pro/u/Thomas_Anode_FR)\
**Post date:** [August 30, 2023, 8:21am UTC](https://community.piwik.pro/t/new-e-commerce-guides-references/2269/5 "2023-08-30T08:21:58Z")

</div>

Hello,

Isn’t the event “ecommerceCartUpdate” supposed to be sent once per session?

If so, the documentation says it should be used “once per page”, which is misleading:

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/piwikpro/original/2X/4/491db757f44da100dad6c3dc819ee96fbe294576.png)

> **[Guides](https://developers.piwik.pro/en/latest/data_collection/web/guides.html#tracking-cart-updates)**
>
> Installing Tracking code: Using Tag Manager’s snippet is the recommended and also the easiest way of installing tracking code on your website. When Tag Manager is added to the site, it automaticall...

Thank you!

---

<div class="post-metadata">

**Author:** ![joao](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/joao/32/1820_2.png) [@joao](https://community.piwik.pro/u/joao)\
**Post date:** [October 9, 2023, 1:29pm UTC](https://community.piwik.pro/t/new-e-commerce-guides-references/2269/6 "2023-10-09T13:29:41Z")

</div>

I agree, the way Piwik PRO manages cart updates and abandoned carts is _very_ confusing.

The official [documentation](https://developers.piwik.pro/en/latest/data_collection/web/guides.html#tracking-cart-updates) says :

> Tracking a cart update has two steps:
> 
> - cart update ([ecommerceCartUpdate](https://developers.piwik.pro/en/latest/data_collection/web/javascript_tracking_client/api.html#jtc-api-ecommercecartupdate))
> - product addition and removal ([ecommerceAddToCart](https://developers.piwik.pro/en/latest/data_collection/web/javascript_tracking_client/api.html#jtc-api-ecommerceaddtocart) and [ecommerceRemoveFromCart](https://developers.piwik.pro/en/latest/data_collection/web/javascript_tracking_client/api.html#jtc-api-ecommerceremovefromcart))

But now that the **[Ecommerce cart update](https://help.piwik.pro/support/tag-manager/ecommerce-cart-update-tag/)** tag has been released with version 18.2, it says that we can’t use it with the **Ecommerce add to cart** or the **Ecommerce remove from cart** tags, because it conflicts with them?! 🤨

How exactly are we supposed to be using the new Ecommerce cart-related tags then?

---

<div class="post-metadata">

**Author:** ![anthonybartczak](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/anthonybartczak/32/2430_2.png) [@anthonybartczak](https://community.piwik.pro/u/anthonybartczak)\
**Post date:** [October 9, 2023, 2:22pm UTC](https://community.piwik.pro/t/new-e-commerce-guides-references/2269/7 "2023-10-09T14:22:29Z")

</div>

Hi @joao!

It’s best to check and use [this guide](https://help.piwik.pro/support/getting-started/track-ecommerce) when it comes to ecommerce tracking.

It is true that the cart update and add to cart or remove from cart methods **should not** be used together. Sorry for the inconvenience - we’ll update the `developers.piwik.pro` documentation as it contains some outdated info.

---

<div class="post-metadata">

**Author:** ![joao](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/joao/32/1820_2.png) [@joao](https://community.piwik.pro/u/joao)\
**Post date:** [October 9, 2023, 2:59pm UTC](https://community.piwik.pro/t/new-e-commerce-guides-references/2269/8 "2023-10-09T14:59:47Z")

</div>

Hi @anthonybartczak , thank you for the documentation link. While the documentation clearly explains how to create these 3 cart-related tags, it doesn’t really explain when we should be using the **Ecommerce cart update** over the other 2 tags.

Am I correct in assuming that the way these tags should be used is as follows:

- We should trigger the **Ecommerce add to cart** and **Ecommerce remove from cart** tags whenever a user adds products to a cart or remove products from a cart, respectively. The products array sent with these tags should only contain the products and quantities added/removed for that event (similar to GA4 add\_to\_cart and remove\_from\_cart events).
- Or, we should trigger the **Ecommerce cart update** tag each time the cart is updated, and in this case the products array should include all products and quantities contained in the cart after the update (similar to a GA4 view\_cart event).

Is this correct? Thank you.

---

<div class="post-metadata">

**Author:** ![anthonybartczak](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/anthonybartczak/32/2430_2.png) [@anthonybartczak](https://community.piwik.pro/u/anthonybartczak)\
**Post date:** [October 9, 2023, 3:20pm UTC](https://community.piwik.pro/t/new-e-commerce-guides-references/2269/9 "2023-10-09T15:20:11Z")

</div>

@joao `add to cart` and `remove from cart` should be used instead of the `cart update` tag (or method) **where it’s possible** because it provides some additional data you can use in the Analytics module:

- `Adds to cart`
- `Removes from cart`
- `Cart-to-detail rate` (combined with product detail views)

This approach simply allows for a more detailed ecommerce interaction analysis (e.g. creating user flow reports based on add to cart or remove from cart events).

Some ecommerce sites don’t have these events implemented (add to cart, remove from cart) and therefore using `ecommerceCartUpdate()` each time the cart content changes might be the proper solution in their case.

I wouldn’t compare `ecommerceCartUpdate()` to GA4 `view_cart` as the Piwik PRO one is not an event that you can use in Analytics - its only purpose is to update the Piwik PRO cart so it contains the visitor’s current cart content. It doesn’t indicate that the visitor has viewed the cart content.

---

<div class="post-metadata">

**Author:** ![joao](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/joao/32/1820_2.png) [@joao](https://community.piwik.pro/u/joao)\
**Post date:** [October 9, 2023, 3:32pm UTC](https://community.piwik.pro/t/new-e-commerce-guides-references/2269/10 "2023-10-09T15:32:28Z")

</div>

@anthonybartczak This is good know, thank you so much. 🙏

Maybe I didn’t read the documentation carefully enough, but I don’t remember seeing anywhere that the **recommended method is to use the add to cart and remove from cart events** , like you just said. This is actually what I am currently using, but only because I didn’t really understand how the cart update tag should be used! 😂

---

<div class="post-metadata">

**Author:** ![anthonybartczak](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/anthonybartczak/32/2430_2.png) [@anthonybartczak](https://community.piwik.pro/u/anthonybartczak)\
**Post date:** [October 9, 2023, 3:36pm UTC](https://community.piwik.pro/t/new-e-commerce-guides-references/2269/11 "2023-10-09T15:36:36Z")

</div>

No problem at all. Perhaps the article/documentation could be worded better. I’ll note this down 😉.

---

<div class="post-metadata">

**Author:** ![joao](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/joao/32/1820_2.png) [@joao](https://community.piwik.pro/u/joao)\
**Post date:** [October 10, 2023, 7:19am UTC](https://community.piwik.pro/t/new-e-commerce-guides-references/2269/12 "2023-10-10T07:19:00Z")

</div>

@anthonybartczak My fault, this is already pretty clear in the current [documentation page](https://help.piwik.pro/support/getting-started/track-ecommerce/), it appears that the page was substantially updated since the last time I read it a couple of months ago 😃 :

> We recommend using scenario 1B, where you track when users add items to their cart and when they remove items from it. This scenario lets you collect metrics such as `Adds to cart`, `Removes from cart` and `Cart-to-detail rate`; use the add-to-cart and remove-from-cart events as funnel steps and; analyze how users interact with the cart in the user flow report.

> If you can’t track the add-to-cart and remove-from-cart events separately, you can use scenario 1A, which tracks updates to the cart. But it’s better to use scenario 1B when you can.

Maybe it would be helpful to have a “last updated date” information somewhere on your documentation pages, as currently it’s a bit hard to know if something was changed recently.
