Issues with sGTM Piwik PRO tags

Hello,

I am new to Piwik PRO - core plan, just started to play with it and trying to get familiar with the tags, setup, etc.

I am using your official sGTM tag template with GA4 as a client. (I DONT have any Piwik tag on client-side, only on sGTM)
I noticed that if I use “inherit from client” everything is ok, the only thing that I want to change is the Item sku since it automatically populate with item_id instead of sku.

So, I tried to add in the Additional Parameters section (knowing that this will override inherited params) the “new” sku.
Looking at the documentation I was unable to find the correct param for that, so I tried with “sku” and “product_sku” (I found both in the documentation)
Unfortunately this did not work.

Can you please give some guidance on that?

Also, I noticed that when I wanted to switch from “inherit from client” to select the specific ecomm event type, in piwik tracker debugger i get this error “Error message: Tracking parameter e_t has invalid value. unknown variant product_detail_view, expected one of order, abandoned-cart, cart-update, product-detail-view, add-to-cart, remove-from-cart at line 1 column 598”

Is pretty confusing for me to see inside the tag, in the drop down, “product_detail_view” with underscore since the correct event is with dashes.

So, again, I am new to piwik pro and maybe I am making some big mistakes, but I am here to learn.

Thanks!
.

Hi @Alin!

  1. The SKUs are usually nested inside the ec_products parameter. Each product is an array, so each parameter (like SKU) has its index. SKUs should be 1st in the array, so the index is 0.

  1. As for the event type issue - I’ll look into this. Thanks for letting us know.

Hi, @anthonybartczak,

Thanks for your response.
Here are some screens shots to make my problem clear.

This is Piwik Pro tag from sGTM.

In Ecommerce seciton, for „Ecommerce Event Type” I have „Inherit from client”.
I am trying to over-write the SKU param since in Tracker Debugger I get the ID instead of the SKU, as you can see below.

This is what items contain on Event Data.

So, inside the Piwik Pro tag, in Additional Parameters, what parameter name should I use for SKU?

Also, as you can see, I am trying the same with „brand”. Actually, there is a list where I can see these parameters for all the events?

This will be my first problem.
Now, the second one, with switching from „Inherit from Client” to dedicated tags for each event…


(ignore the fact that the tag is paused)

As you can see I choose product_detail_view (so here is the issue with _ and -) but I get an error in Tracket Debugger.

So, for the second question, what would be the best practice when I want to use dedicated tags for each event (so I am NOT using Inherit from Client) and where can I see the dedicated params for each event?

Thanks,
Alin

The Piwik PRO tag automatically converts GA4 items array to fit the Piwik PRO schema. Have you tried using a transformation on the event data object provided by the GA4 client? You can also restrict it to the Piwik PRO tag I guess.

Yep, here:

Looks like a bug, we’ll fix this. As for the documentation - use the same link I mention above. Search for parameters that start with ec_.

Hei, @anthonybartczak

Problem is partially solved.

Using this transformation


I get the right result for view_item event, meaning that SKU is used instead of item_id.

But in case of a purchase/order event, obviously only the first item from the array will have SKU changed.
Do you know a workaround for transforming arrays?

PS: if I need to use Transformation in order to modify some params, then the Additional Parameters section from the tag what will be used for? Can you give me please at least one use case so I better understand the difference between Transformations and Additional Parameters.

Thanks,
Alin

Hi,

this custom variable template should help you to re-map the whole items array: Tag Manager Template Gallery

best
Markus

Thanks, @mbaersch!

I will monitor to see how this solution will go. For now, everything looks good.

But, again, this is a temporary solution and only if I use „Inherit from client”.
I will wait for a tag template update so I can properly use dedicated tags for each ecomm event.
For me is still unclear how to use „Additional parameters” section inside the tag.

The SKU itself is not a parameter - it’s a part of a different parameter (ec_products). You could use Additional parameters to e.g. force anonymization (uia=1), enable device data anonymization (dda=1) or even change the mentioned SKU by changing ec_products. I just thought that transformations might be better in this case.

Thanks, @anthonybartczak, for your reponse.

Ok, got it related to Additional Params.
But related to using dedicated tags for ecomm (so, NOT using Inherit from Client) I guess that I should wait for a tag template update, right?

Until then, can you please point me (in the documentation - cuz I was unable to find) what param should I send with an “order” event, let’s say?
Maybe I have wrong expectations, but I was looking for smth like this

Thanks,
Alin

Yep, the code is ready and waiting for review

You should be looking at parameters starting with ec_.

Also might be useful:

Step 16: Order completed

If the &idgoal parameter is 0 and the &ec_id parameter is present, or the &e_t parameter has the value 'order', the event is marked as Order completed.

Example of the parameters:

"e_t": "order",
"ec_id": "1",
"ec_products": "[["772","Product C",["Pyramid"],"25","1","TriangularTech","Blue"]]",
"ec_sh": "25",
"ec_tx": "1.81",
"idsite": "2c033ca9-3016-4537-be01-d556371b8fc3",
"pv_id": "32xliL",
"rec": "1",
"res": "2342x1317",
"revenue": "51.81",
"url": "https://ecommerce.demo.piwikpro.com/checkout",

@Alin FYI the event type issue should be fixed now

Thanks, @anthonybartczak for the update.

I will take a look.