Ecommerce tracking

Hi.

Sorry if this has been asked before, I have had a search and couldn’t find it.

we use 1shoppingcart and I am trying to add the tracking code to enable us to track ecommerce transactions.

1shoppingcart give us all the variables needed
[ul]
[li]orderID – Order number
[/li][li]name – Name listed in the billing address
[/li][li]sku – The SKU of the purchased product(s)
[/li][li]etc etc
[/li][/ul]

however I cant see a way of adding them to my tracking script.

These are all post variables but how do I get them from the post and into my tracking code?

I hope that’s clear - I know what I’m trying to say, just not sure if its coming out right!!!

Thanks
Chris

Maybe ask a developer familiar with your shopping cart for a Piwik integration / custom development

Thanks.

Got it sorted in the end, I had to use a custom thank you page and direct 1sc through to that.

Thanks
Chris

Hi.

I have discovered that the custom thank you page is not very reliable because it relies on the client clicking ‘complete purchase’ which doesn’t always happen.

I have since found out that 1shoppingcart outputs a javascript array of the order details into the hosted thank you page that I can then access with my tracking code.

does this look correct to allow me to track the sales etc.


<script type="text/javascript">
//<![CDATA[
var SecureCartOrders = [ {"orderID":214664817,"name":"Test Purchase","company":null,"email1":"testpurchase@email.com","address1":"address1","address2":null,"city":"city","state":null,"zip":"postcode","country":"United Kingdom","fax":null,"phone":"telephone","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><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.website.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>

Thanks
Chris

looks good to me