title: Use Wicket to generate Google Analytics e-commerce tracking
body: <p>I'm developing an e-commerce using Wicket to render pages. I have a "BasePage" with the main layout and, in my "thank you for purchasing" page, I want to add Google Analytics e-commerce tracking code. As reference, the JS code like this:</p>
  
  <pre><code>&lt;script type="text/javascript&gt;
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-12345678-9']);
    _gaq.push(['_addTrans', '123', '', '12.56', '', '5.00']);
    _gaq.push(['_addItem', '123', 'sku-1', 'Product 1', 'Category X', '12.56', '1']);
    _gaq.push(['_addItem', '123', 'sku-2', 'Product 2', 'Category Y', '13.45', '1']);
    _gaq.push(['_trackTrans']);
    (function() {
      var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
      ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
      var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();
  &lt;/script&gt;
  </code></pre>
  
  <p>HTML code for cart and checkout was easy, but how can I generate this JS dynamically with Wicket?</p>