# Ecommerce (Woocommerce) tracking setup help needed

**URL:** https://community.piwik.pro/t/ecommerce-woocommerce-tracking-setup-help-needed/757
**Category:** Data collection and tags
**Created:** [June 25, 2022, 3:00pm UTC](https://community.piwik.pro/t/ecommerce-woocommerce-tracking-setup-help-needed/757 "2022-06-25T15:00:19Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![soldier99](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/soldier99/32/496_2.png) [@soldier99](https://community.piwik.pro/u/soldier99)
#### Post date: [June 25, 2022, 3:00pm UTC](https://community.piwik.pro/t/ecommerce-woocommerce-tracking-setup-help-needed/757/1 "2022-06-25T15:00:19Z")

</div>

Hi,  
Sorry for the newbie question but I’m really struggling here with the e-commerce tracking setup. We are using Wordpress/Woocommerce and at the moment I have added these tags to my site (e-commerce cart update and e-commerce order confirmation) that are shown in the docs.

Cart update tag is this:

```auto
<script>
      var _paq = _paq || [];
      var cart_amount = {{ cart_amount }};
      var products = {{ products }};
      products.forEach(function(product){
        _paq.push(["addEcommerceItem",product.sku, product.name,product.category, product.price, product.quantity])
      });
      _paq.push(["trackEcommerceCartUpdate",cart_amount]);  
    </script>

```

Order confirmation tag is this:

```auto
<script>
     var _paq = _paq || [];
     var products = {{ products }};
     products.forEach(function(product){
       _paq.push(["addEcommerceItem",product.sku, product.name,product.category, product.price, product.quantity])
   });
     _paq.push(["trackEcommerceOrder",{{ order_id }}, {{ grand_total }}, {{ subtotal }}, {{ tax }}, {{ shipping }}, {{ discount }}]);
   </script>

```

If I run tag debugger then it shows that tags are loaded on my site, but it seems that it doesn’t track anything.

Please advise what is it I’m doing wrong here or what should I do in order to make tracking work.

Thanks,  
J.

---

<div class="post-metadata">

### Author: ![kuba](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/kuba/32/7_2.png) [@kuba](https://community.piwik.pro/u/kuba)
#### Post date: [June 28, 2022, 1:08pm UTC](https://community.piwik.pro/t/ecommerce-woocommerce-tracking-setup-help-needed/757/2 "2022-06-28T13:08:46Z")

</div>

I’d suggest double checking if the field types are correct. Docs are available [here](https://developers.piwik.pro/en/latest/data_collection/web/javascript_tracking_client/api.html). For instance, product.sku and order\_id have to be strings. Some code examples are also available [here](https://help.piwik.pro/support/getting-started/track-ecommerce/?). Also, do you see any errors in browser’s console?

---

<div class="post-metadata">

### Author: ![soldier99](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/soldier99/32/496_2.png) [@soldier99](https://community.piwik.pro/u/soldier99)
#### Post date: [June 28, 2022, 1:36pm UTC](https://community.piwik.pro/t/ecommerce-woocommerce-tracking-setup-help-needed/757/3 "2022-06-28T13:36:02Z")

</div>

Hi,

Thank you for your answer.

Unfortunately I’m not good at programming or JavaScript, and therefore I have no knowledge about how to add those fields as strings 🙂  
I tried to hire someone from Fiverr but got no offers. Although, everyone offered my “I can make Google Analytics ecommerce tracking to work.”

If you have time you can take a look at [my test site here.](https://shop.wpsimpletuts.com/) It has these tags and tracking added.

Currently, console displays this error:

```auto
Uncaught TypeError: Cannot read properties of undefined (reading 'forEach')
    at <anonymous>:4:15
    at Object.i [as appendChild] (a2a75c35-23ed-49bc-b12d-5161b7e977d5.js:8:16850)
    at a2a75c35-23ed-49bc-b12d-5161b7e977d5.js:11:827
    at Object.forEach (a2a75c35-23ed-49bc-b12d-5161b7e977d5.js:8:25107)
    at u (a2a75c35-23ed-49bc-b12d-5161b7e977d5.js:11:797)
    at Object.render (a2a75c35-23ed-49bc-b12d-5161b7e977d5.js:11:1404)
    at n.render (a2a75c35-23ed-49bc-b12d-5161b7e977d5.js:11:76)
    at Object.handle (a2a75c35-23ed-49bc-b12d-5161b7e977d5.js:11:2371)
    at r (a2a75c35-23ed-49bc-b12d-5161b7e977d5.js:11:2928)
    at Object.handle (a2a75c35-23ed-49bc-b12d-5161b7e977d5.js:11:3469)
VM78:5 Uncaught TypeError: Cannot read properties of undefined (reading 'forEach')
    at <anonymous>:5:16
    at Object.i [as appendChild] (a2a75c35-23ed-49bc-b12d-5161b7e977d5.js:8:16850)
    at a2a75c35-23ed-49bc-b12d-5161b7e977d5.js:11:827
    at Object.forEach (a2a75c35-23ed-49bc-b12d-5161b7e977d5.js:8:25107)
    at u (a2a75c35-23ed-49bc-b12d-5161b7e977d5.js:11:797)
    at Object.render (a2a75c35-23ed-49bc-b12d-5161b7e977d5.js:11:1404)
    at n.render (a2a75c35-23ed-49bc-b12d-5161b7e977d5.js:11:76)
    at Object.handle (a2a75c35-23ed-49bc-b12d-5161b7e977d5.js:11:2371)
    at r (a2a75c35-23ed-49bc-b12d-5161b7e977d5.js:11:2928)
    at Object.handle (a2a75c35-23ed-49bc-b12d-5161b7e977d5.js:11:3469)

```

---

<div class="post-metadata">

### Author: ![kuba](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/kuba/32/7_2.png) [@kuba](https://community.piwik.pro/u/kuba)
#### Post date: [June 28, 2022, 5:47pm UTC](https://community.piwik.pro/t/ecommerce-woocommerce-tracking-setup-help-needed/757/4 "2022-06-28T17:47:26Z")

</div>

It will be hard to set it up without at least some JavaScript knowledge. As you can see in the code, to make it work, you need to define the variables that contain the product data. Your setup is missing this part. Going through the entire setup for Woocommerce isn’t something that can be solved via forums thread.

As a side note, I’ve heard that one of our partners is considering creating Woocommerce plugin that would do all the work for you.

---

<div class="post-metadata">

### Author: ![soldier99](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/soldier99/32/496_2.png) [@soldier99](https://community.piwik.pro/u/soldier99)
#### Post date: [June 28, 2022, 6:36pm UTC](https://community.piwik.pro/t/ecommerce-woocommerce-tracking-setup-help-needed/757/5 "2022-06-28T18:36:28Z")

</div>

Thanks. Do you know anyone who I could hire for this gig?

> As a side note, I’ve heard that one of our partners is considering creating Woocommerce plugin that would do all the work for you.

It would be great and would help a lot. Any ETA of this is not known yet?

---

<div class="post-metadata">

### Author: ![kuba](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/kuba/32/7_2.png) [@kuba](https://community.piwik.pro/u/kuba)
#### Post date: [July 20, 2022, 8:49am UTC](https://community.piwik.pro/t/ecommerce-woocommerce-tracking-setup-help-needed/757/6 "2022-07-20T08:49:30Z")

</div>

As a small update, we’ve discussed this matter internally and will be working on the woocommerce plugin soon. Still, it might take some time until it’s released.

---

<div class="post-metadata">

### Author: ![soldier99](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/soldier99/32/496_2.png) [@soldier99](https://community.piwik.pro/u/soldier99)
#### Post date: [July 20, 2022, 9:36am UTC](https://community.piwik.pro/t/ecommerce-woocommerce-tracking-setup-help-needed/757/7 "2022-07-20T09:36:16Z")

</div>

Thank you for the update.

---

<div class="post-metadata">

### Author: ![mahevo](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@mahevo](https://community.piwik.pro/u/mahevo)
#### Post date: [February 1, 2023, 9:07am UTC](https://community.piwik.pro/t/ecommerce-woocommerce-tracking-setup-help-needed/757/8 "2023-02-01T09:07:27Z")

</div>

Hi all  
@kuba is there any news regarding the woocommerce plugin? Thank you very much for a short reply.  
Kind regards  
Manuel

---

<div class="post-metadata">

### Author: ![rmastop](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/rmastop/32/29_2.png) [@rmastop](https://community.piwik.pro/u/rmastop)
#### Post date: [February 10, 2023, 7:40am UTC](https://community.piwik.pro/t/ecommerce-woocommerce-tracking-setup-help-needed/757/9 "2023-02-10T07:40:07Z")

</div>

The new Piwik PRO Wordpress plugin helps in ecommerce tracking for Woocommerce

Read the steps here:

> **[WooCommerce: install a container (with a tracking code) | Piwik PRO help center](https://help.piwik.pro/support/getting-started/woocommerce-install-a-container-with-a-tracking-code/)**
>
> If you’re running your online store on WooCommerce, you can quickly start collecting shopper data using our dedicated WordPress plugin. The plugin will install our container with a tracking code, which will automatically track ecommerce events like...
