Use this tag instead of the equivalent html tag <script>…</script> to compress (via html) the javascript content
Name | Mandatory | Description |
---|---|---|
Body | Yes | The javascript content |
... | All standard HTML script paramaters (like type=“text/javascript”) will be put in the result |
<#script type=“text/javascript”> …javascript… <#endscript>
<#script type="text/javascript"> //<![CDATA[ var _gaq = _gaq || []; _gaq.push( <#_comma setValue=''> <#for var="i" from="0" to="<#Analytics_Trackers.count> - 1"> <#_comma><#_comma setValue=','> ['<#Analytics_Trackers[<#i>].prefix>._setAccount', '<#Analytics_Trackers[<#i>].GoogleAnalyticsAccount>'], ['<#Analytics_Trackers[<#i>].prefix>._setDomainName', '<#basehref OnlyDomainName="1">'], ['<#Analytics_Trackers[<#i>].prefix>._setAllowLinker', true], ['<#Analytics_Trackers[<#i>].prefix>._trackPageview'<#if condition="('<#Analytics_Trackers[<#i>].pageURL>' <> '')">, '<#Analytics_Trackers[<#i>].pageURL>'<#endif>] <#endfor> <#for var="i" from="0" to="<#Analytics_Trackers.count> - 1"> <#for var="j" from="0" to="<#Analytics_Transactions.count> - 1"> <#_comma> ['<#Analytics_Trackers[<#i>].prefix>._addTrans', '<#Analytics_Transactions[<#j>].transactionId', '<#Analytics_Transactions[<#j>].affiliation', '<#Analytics_Transactions[<#j>].total', '<#Analytics_Transactions[<#j>].tax', '<#Analytics_Transactions[<#j>].shipping', '<#Analytics_Transactions[<#j>].city', '<#Analytics_Transactions[<#j>].state', '<#Analytics_Transactions[<#j>].country'], <#for var="k" from="0" to="<#Analytics_Transactions[<#j>].items.count - 1"> ['<#Analytics_Trackers[<#i>].prefix>._addItem', '<#Analytics_Transactions[<#j>].transactionId', '<#Analytics_Transactions[<#j>].items[<#k>].sku', '<#Analytics_Transactions[<#j>].items[<#k>].name', '<#Analytics_Transactions[<#j>].items[<#k>].category', '<#Analytics_Transactions[<#j>].items[<#k>].price', '<#Analytics_Transactions[<#j>].items[<#k>].quantity'], <#endfor> ['<#Analytics_Trackers[<#i>].prefix>._trackTrans'] <#endfor> <#endfor> ); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); //]]> <#endscript>
The above example will output:
<script type="text/javascript"> //<![CDATA[ var _gaq = _gaq || [];_gaq.push(['UA_4457541_1._setAccount', 'UA-4457541-1'],['UA_4457541_1._setDomainName', 'arkadia.com'],['UA_4457541_1._setAllowLinker', true],['UA_4457541_1._trackPageview'],['UA_35572971_1._setAccount', 'UA-35572971-1'],['UA_35572971_1._setDomainName', 'arkadia.com'],['UA_35572971_1._setAllowLinker', true],['UA_35572971_1._trackPageview']);(function() {var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})(); //]]> </script>