Magneto get orders items attributes.

i need to overwrite Mage core google analytics code.

Class Mage_GoogleAnalytics_Block_Ga

Function _getOrdersTrackingCodeUniversal

$orderIds = 'your order id'
if (empty($orderIds) || !is_array($orderIds)) {
return;
}
$collection = Mage::getResourceModel('sales/order_collection')
->addFieldToFilter('entity_id', array('in' => $orderIds));

$result = array();
$result[] = "ga('require', 'ecommerce')";
foreach ($collection as $order) {
$result[] = sprintf("ga('ecommerce:addTransaction', {
'id': '%s',
'affiliation': '%s',
'revenue': '%s',
'tax': '%s',
'shipping': '%s'
});",
$order->getIncrementId(),
$this->jsQuoteEscape(Mage::app()->getStore()->getFrontendName()),
$order->getBaseGrandTotal(),
$order->getBaseTaxAmount(),
$order->getBaseShippingAmount()
);
foreach ($order->getAllVisibleItems() as $item) {
//for items attributes
$product =Mage::getModel('catalog/product')->load(
$item->getProductId());
$finalPrice=$product->getRulePrice();

if(is_null($finalPrice))
{
$finalPrice = $item->getBasePrice();
}


$result[] = sprintf("ga('ecommerce:addItem', {
'id': '%s',
'sku': '%s',
'name': '%s',
'category': '%s',
'price': '%s',
'quantity': '%s'
});",
$order->getIncrementId(),
$this->jsQuoteEscape($item->getSku()),
$this->jsQuoteEscape($item->getName()),
null, // there is no "category" defined for the order item
$finalPrice,
$item->getQtyOrdered()
);
}
$result[] = "ga('ecommerce:send');";