The below two files should be for whichever template you have got running.
OPEN FILE: app/design/frontent/default/your_template/template/checkout/success.phtml
OR: app/design/frontent/default/default/template/checkout/success.phtml
BELOW:
<?php echo $this->__('Your order # is: %s', $this->getViewOrderUrl(), $this->getOrderId()) ?>.<?php else :?><?php echo $this->__('Your order # is: %s', $this->getOrderId()) ?>.<?php endif;?>
PASTE:
<?php $order_details = Mage::getModel('sales/order')->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId());?>
<script>
<!--
var value="<?PHP echo $order_details->subtotal; ?>";
var ref="<?PHP echo $this->getOrderId(); ?>";
var mid="XXXX";
var goalid="XXXX";
//-->
</script>
<script src="https://aflite.co.uk/js/track.js"></script>