Ok - so I have written this code to output values using JSP and set them as JS variables so I can pass them to my Google Analytics tracking code.
<dsp:droplet name="/atg/dynamo/droplet/ForEach">
<dsp:param value="${CommerceItems}" name="array" />
<dsp:param name="elementName" value="CommerceItem" />
<dsp:oparam name="outputStart">var itemCatList ='</dsp:oparam>
<dsp:oparam name="output"
<dsp:getvalueof id="Category"param="CommerceItem.auxiliaryData.productRef.productWebType.productWebTypeDescription">${Category}|</dsp:getvalueof>
</dsp:oparam>
<dsp:oparam name="outputEnd">'; </dsp:oparam>
</dsp:droplet>
Im not sure if this is the correct way to go about doing this - previously the values were set to hidden inputs - then JS is used to grab those values out. I was trying to eliminate the extra code.
Any issues with doing it this way?