Shopify store ecommerce tracking

Hi Community? I want to track e-commerce orders from Shopify store. I have seen the articles which say e-commerce order tracking can not be implemented using Javascript on checkout page. The reason is Shopify does not allow to execute third party Javascript code. So, I did this using image beacon.

Here is the sample code.

{% capture products_list %}
{% for line_item in line_items %}
[item{{forloop.index}} {{ line_item.sku }},"","",{{line_item.price}},{{line_item.quantity}}]
{% if forloop.last == false %}::{% endif%}
{% endfor %}
{% endcapture %}
{% assign products_array = products_list , split: '::'%}	
{{ products_array }}

<img src="{{ order_number }}&revenue={{total_price}}&ec_items=[{{products_array}}]" style="border:0;" alt="" />

However, I am facing following issue through this code.
1: Product SKU is empty string.
2: Product name is empty string.
3: On checkout page I set the product quantity 1 but on Matomo dashboard it is being displayed as zero.
4: The tracking of this checkout page make a new visitor entry on Matomo dashboard page. Please have a look at attached file.

Hi Naser

I just came to post the same thing, did you ever get this working?


Have a look at: E-commerce order quantity is zero - Support & Bugs - Matomo forums

@adsham yes, everything is working fine.

Great - I have tried using your code above (we are implementing on Shopify site but I am having a problem with everything being empty. Do you have any ideas?

Any guidance you can provide would be most helpful. Many thanks in advance!