Highlighted

How can I pass my entire JSON format utag.data object into tag variable?

Silver Contributor
Silver Contributor
I am using snowplow analtyics and would like to pass the entire utag.data object into snowplow as an unstructured event. // Tells Snowplow this is a viewed_product event schema: 'iglu:com.my_company/viewed_product/jsonschema/1-0-0', data: { // The event data itself "product_id": "ASO01043", "price": 49.95 } In the tag manager I have the ability to map a datalayer element to unstct.Data.data but I want to map the entire datalayer into that.
1 REPLY 1
Highlighted

How can I pass my entire JSON format utag.data object into tag variable?

Employee Emeritus

Hey Joe, You could try the following:

 

1. Make a new data source titled "full_udo"

2. Map it to your tag's desired destination

3. Create a set data value extension where: full_udo is Javascript like follows: JSON.stringify(b)

 

Some caveats to keep in mind. Although this won't work on older versions of IE because this function doesn't exist (you could have a preloader that creates this function if it doesn't exist though), and if your UDO is large, you might hit the GET character limit on older browsers (this is why some tags like GUA and newer SiteCat turn the hit into a POST instead).