# Piwik Integration with WordPress for ECommerce

**URL:** <https://community.piwik.pro/t/piwik-integration-with-wordpress-for-ecommerce/213>\
**Category:** Reports and working with data\
**Created:** [July 22, 2021, 7:02am UTC](https://community.piwik.pro/t/piwik-integration-with-wordpress-for-ecommerce/213 "2021-07-22T07:02:39Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![pslonina](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/pslonina/32/1711_2.png) [@pslonina](https://community.piwik.pro/u/pslonina)\
**Post date:** [August 2, 2021, 10:19am UTC](https://community.piwik.pro/t/piwik-integration-with-wordpress-for-ecommerce/213/15 "2021-08-02T10:19:09Z")

</div>

Hello @Mihir_Jadi,  
I’ve reviewed your setup and it seems we are almost there, yet there are still some bits and pieces that require a slight touch-up. Please see more details below:

1. General observations

- There is an additional condition defined for the **All page views** trigger (it fires only on /checkout/order-received page path). Please note that **Piwik PRO** tag relies on this trigger, and therefore - the **Piwik PRO tag** doesn’t work correctly at the moment.

1. The Product page

> Single product page: [https://lxt.gbtevents.com/product/prestbury-golf-club-thurs-7th-oct-2021/](https://lxt.gbtevents.com/product/prestbury-golf-club-thurs-7th-oct-2021/)

- Currently, the **Add to Basket** tag is fired on page view on the product page (the **Product View** trigger). You might want to reconsider this.
- The ` _paq.push(["trackEcommerceCartUpdate",cart_amount]); ` line is missing in the **Add to Basket** tag, please see the example in [this article](https://community.piwik.pro/t/how-to-set-up-ecommerce-tracking/79/2).
- Ideally - the data layer event should be pushed once a user clicks on the **Add to basked** button. It should represent the whole cart (not only the product the user is currently looking at)
- The **cart\_amount** key-value pair is missing in the data layer object (please see the example in [this article](https://community.piwik.pro/t/how-to-set-up-ecommerce-tracking/79/2))
- Please note that the SKU should be a string (you can either change it in the data layer object or use `.toString()` method in your tags.

1. The cart

> Cart page: [https://lxt.gbtevents.com/basket/](https://lxt.gbtevents.com/basket/)

- Please note that the SKU should be a string (you can either change it in the data layer object or use `.toString()` method in your tags.
- The **Cart Update** tag and the **cart\_update** data layer both look good, but the **cart\_update** object should be pushed to the data layer every time something is added to the cart (or removed from the cart).

1. Order confirmation

> Order received page: [https://lxt.gbtevents.com/checkout/order-received/9342/?key=wc\_order\_g0FmtJWKriV0K](https://lxt.gbtevents.com/checkout/order-received/9342/?key=wc_order_g0FmtJWKriV0K)

- The **Test order confirmation** tag is being executed by 2 triggers - **order\_confirmation** and **All page views** (the one with the condition described above). That makes the tag to fire twice.
- Please note that the SKU should be a string (you can either change it in the data layer object or use `.toString()` method in your tags.

To summarize what should be done in order for this implementation to work correctly:

1. Please fix the **All page views** trigger and make sure the **Piwik PRO** tag works correctly. If the Piwik PRO tag doesn’t fire - other tracker methods won’t work either (It’s one of the reasons behind the issues described in [the other post](https://community.piwik.pro/t/not-getting-abandoned-cart-data-in-ecommerce-analytics/218).
2. You only need 2 tags/2 data layer objects:

- Cart update - anytime anything is added/removed to/from the cart.
- Order confirmation - anytime an order is confirmed/

1. Please make sure that the SKU is a string (you can either change it in the data layer object or use `.toString()` method in your tags. This is one of the reasons behind the issues described in [the other post](https://community.piwik.pro/t/not-getting-abandoned-cart-data-in-ecommerce-analytics/218).

I hope the above helps. Please don’t hesitate to submit additional questions under this thread 😉

---

_[View the full topic](https://community.piwik.pro/t/piwik-integration-with-wordpress-for-ecommerce/213)._
