It is very simple to add your tracking code to a current SagePay integration. The tracking code should be installed onto the page success callback page.
<?PHP
require 'sagepayFunctions.php';
$strDecoded=simpleXor(Base64Decode($crypt),$strEncryptionPassword);
$values = getToken($strDecoded);
$strAmount=number_format($values["Amount"],2);
$strVendorTxCode=$values["VendorTxCode"];
?>
<script language="JavaScript" type="text/javascript">
<!--
var value="<?=$strAmount?>"; //Value of sale
var ref="<?=$strVendorTxCode?>"; //Your unique reference
var mid="exampleMerchantID";
var goalid="exampleGoalID";
// -->
</script>
<script type="text/javascript" language="JavaScript" src="http://aflite.co.uk/js/track.js"></script>