Object, Object instead of real data

I have in my web container a data variable that is an object with an array, for example

{
ecomm_pagetype: “category”,
ecomm_pcat: [“ABCD”],
ecomm_prodid: [
“A”,
“B”
],
ecomm_pname: “”,
ecomm_pvalue: “”,
ecomm_totalvalue: “”
}

i have added this in the web container in the event parameters but in sgtm i only get “object, object”

I have searched a lot for finding a solution but nothing worked.

How can i transfer this data from web gtm ga4 to sgtm ga4 ?

Name Value
abc “[object Object]”

Hello Daniel,

[object Object] is how binary objects get displayed for lack of ability to read them, the reason why you see [object Object] is that somewhere in your setup a JSON (or some other object) is passed into event_name field.
My suggestion would be to comb through event_names on the web container.

Hi,
yes thats correct but i need the value of the data layrer parameter as event parameter :wink: Its working on web-gtm but not on sgtm. I tried it with Data Client but i dont get it to work to take the value from data client and transfer it to ga4.

The GA4 tag when sending server side can only send single fields I believe, so you cannot pass an entire object across to the server side container. So for the fields you want, you need to pull them all out by individual path in the client side GA4 tag to pass to the server.

As I understand it that is one reason Stape developed the DataTag/DataClient feature, as that does allow passing entire objects to the server side container. The caveat IMHO is that it’s not useful for GA4 itself (and not recommended) so you then have to pay for two server hits (one for GA4, one for DataTag). For me I am just including the data I need in the GA4 tag one field at a time and using it on the server side to avoid the extra hits as we have a lot of traffic (ie: 2x the $$!).

But if you really need to pass entire objects over, DataTag might be the solution.

You could try making a string out of your variable (for example via JSON.stringify) and then on the server return it to normal via JSON.parse - this might work.

Is there anywhere a detailed manual how to send the data which I send into sgtm by data tag can transfer to ga4 without losing the original ga4

For example (doesn’t make sense but for example)

Event view item
4 parameters are send by ga4 to sgtm
2 parameters that aren’t included ate send by data client to ga4

How can I make that all 6 parameters are send to ga4 outgoing ?

No, there’s no way that’s possible. You can only use parameters from the request on which you trigger the event.