Help Getting Ecommerce To Work With Shopify Site

I’ve setup the main tracking code on my theme and confirmed that is working (so everything shows up as a Page View)

I’m trying to setup the Ecommerce event tracking but am getting absolutely NO WHERE. I have this featured activated on my Google Analytics property and all it took was clicking a couple of buttons.

I’ve read through the FAQs which truthfully make no sense to me and I’ve tried everyone of the “Browse Presents” from both GA Universal and GA4 and none of them are working. I have no clue what the problem is. Am I supposed to copy some other code over to my theme to get Ecommerce to work? The FAQs acted like if you have these events tracked in GA it should be as simple as setting up the Tags in Piwik, but I’m having no luck…

Hi @Snipes,

The ecommerce event tag templates require you to have a dataLayer configured on your website (e.g. Enchanced Ecommerce dataLayer structure). You can send me the URL of your website if you’d like me to check this.

As far as I know Shopify has integrated Google Enchanced Ecommerce tracking into the platform and that’s why the setup takes a couple of clicks.

As of now, Piwik PRO doesn’t have an official integration with Shopify.

EDIT: The tag templates can also be used with other Piwik PRO Tag Manager variables (not only dataLayer ones) but the dataLayer approach is the most reliable.

Thank you for the clarification. I looked it up and it appears you are correct that Shopify does not come with dataLayers, but I found a couple of websites providing code that I could add to my Shopify code to supposedly get that working. So I will give that a try to see if that works. Thanks.

I have not attempt to add dataLayer codes yet but I am getting this error message frequently in tracker debugger all of a sudden.

Broken event

Error message: Tracking parameter ec_products has invalid value. Unable to deserialize ecommerce products JSON: invalid type: null, expected a string at line 1 column 6

Any idea what this means?

It’s best to check the tracker debugger to see the whole request (there’s a small </> icon next to each event once you hover over it).

It seems that one of the fields in the product JSON was a null instead of a string (which is the expected/required type of the value).

You can check the types here.

That is from Tracker debugger, and is the whole request. I don’t see a </>. Maybe when I fix the datalayer this will be resolved? I’m assuming it has something to do with the tags I setup which aren’t working because there is no datalayer on the site.

The mentioned icon should be visible here (once you hover over the event):

If you are seeing this kind of broken event in the tracker debugger then it means that there actually may be a dataLayer on your website :sweat_smile:. It looks like an ecommerce tracking event was triggered but the products variable is not configured properly.