Sorry for the rubbish title!

I am trying to integrate my roi analytics into my shopping cart (1ShoppingCart)

I have discovered that they place the order values etc into the document as a javascript array like so

Code:
<script type="text/javascript">
//<![CDATA[
var SecureCartOrders = [ {"orderID":214664898,"name":"Test Purchase","company":null,"email1":"testpurchase@email.com","address1":"address1","address2":null,"city":"city","state":null,"zip":"Cxxx 9xx","country":"United Kingdom","fax":null,"phone":"0176000003","secondaryphone":null,"cardtype":"Visa","shipname":"Test Purchase","shipCompany":null,"shipAddress1":"address 1","shipAddress2":null,"shipCity":"city","shipState":null,"shipZip":"postcode","shipCountry":"United Kingdom","status":"Accepted","product":["product"],"sku":["bnGold"],"quantity":[1],"price":[1.00],"option":[[]],"productattributes":[{"GBP":"GBP","Dollars":"Dollars"}],"plist":"9733649","Total":1.00,"grandTotal":1.00,"adtrack":608378} ];
//]]>
</script>
to integrate this into my roi script I am doing

Code:
<script type="text/javascript">
<script type='text/javascript'>
var sku = SecureCartOrders[0]['sku'];
var product = SecureCartOrders[0]['product'];
var orderId =  SecureCartOrders[0]['orderID'];
var grandTotal = SecureCartOrders[0]['grandTotal'];
var Total =  SecureCartOrders[0]['Total']
var Shipping =  SecureCartOrders[0]['shipping']

   var _paq = _paq || [];
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  _paq.push(['addEcommerceItem', sku, product, 1  ]);
 _paq.push(['trackEcommerceOrder',
 orderId, // (required) Unique Order ID
 grandTotal, // (required) Order Revenue grand total (includes tax, shipping, and subtracted discount)
 Total, // (optional) Order sub total (excludes shipping)
 Shipping, // (optional) Shipping amount
 false // (optional) Discount offered (set to false for unspecified parameter)
 ]);
 
 (function() {
    var u=(('https:' == document.location.protocol) ? 'https' : 'http') + '://stats.mywebsite.com/';
    _paq.push(['setTrackerUrl', u+'piwik.php']);
    _paq.push(['setSiteId', '1']);
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript';
    g.defer=true; g.async=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
  })();
</script>
Im not sure if this is correct though! I don't seem to get any errors in firebug and I think it looks correct! can some body tell me if im correct!

Thanks
Chris