How to extract contents from SSGTM using variable

89 views Asked by At

currently, I have this query parameter from a server side GTM that I want to extract the value. the parameter is like this. parameter=[{id: "abcd", quantity: 1}]. So I want to extract the vale of this parameter. When I use a an "Event data" variable, I get [object object], but I want to get something like {id: "abcd", quantity: 1} or better still, how can I extract the contents of this parameter. I also used a community template "extract from JSON" and it still did not work.

I tried to use a community template "extract from JSON" and it did not work.

1

There are 1 answers

0
rimed On

If your parameter value is parameter=[{id: "abcd", quantity: 1}], then you can get it with the Event Data Variable. You can set:

parameter.0

To get a specific property you can use (e.g. for id):

parameter.0.id