eCommerce tracking is not working

Hi there!

I have a problem with tracking of eCormmerce.
I have ask my client to set this script on their website:

_paq.push([
event: “ecommerceOrder”,
products: [{
sku: “craft-311”,
name: “Unicorn Iron on Patch”,
category: “Crafts & Sewing”,
price: 500,
quantity: 3,
brand: “DMZ”,
variant: “blue”
}, {
sku: “craft-312”,
name: “Unicorn Iron on Grass”,
category: “Crafts & Sewing”,
price: 300,
quantity: 1,
brand: “DMZ”,
variant: “red”
}],
{
orderId: “order-3415”,
grandTotal: “1800”,
subTotal: “1200”,
tax: “396”,
shipping: “600”,
discount: “180”
}
]);

In the PIWIK tag manager - i have put it up like this:

TAG: custom code (async):

TRIGGER: (Data layer event)
Event name EQUALS ecommerceOrder

This is usually how i set up eCommerce tracking for my clients and normally it works - but not this time! - Does anyone knows where the mistake are?

Hope you can help

Have a lovely day

Cathrine

Hi Cathrine, it seems there are some additional pieces in your code that you don’t need in order to send an ecommerceOrder() method. Both “event:” and “products:” are not needed in this case, so you can just leave “ecommerceOrder” and the list of products by themselves.

I also recommend you to take a look at our article about setting up ecommerce tracking: Set up ecommerce tracking | Piwik PRO help center. You can find practical examples of the methods and sytnax there.

Let me know if this fixes your issue.

Hi there!
Thank you for answering!
I have tried to remove the pieces in my code, that i dont need and yet its not working :frowning:

Hi,

Could you try running the piece of code in the console in developer tools and see if there is any error popping up?

It says this right here :slight_smile:

Thanks! This error is caused because you didn’t include the _paq.push([ at the beginning :smile: Could you try it again with this line at the start?

Still the same :slight_smile:

image

I MADE IT WORK!
Thanks for the help :smiley: :smiley: :smiley:

1 Like