<?php /* @var $this Fooman_GoogleAnalyticsPlus_Block_TagManager */?>
<?php if ($this->shouldInclude()): ?>
   
   <?php $dataLayerDetails = "{'test_version':'2'}";
   	if($this->isSuccessPage()) {
   			$order = $this->_getOrder();
   			$shipping = Mage::helper('googleanalyticsplus')->convert($order, 'shipping_amount');
            $tax = Mage::helper('googleanalyticsplus')->convert($order, 'tax_amount');
            $total_revenue =  Mage::helper('googleanalyticsplus')->convert($order, 'grand_total');
            $revenue = $total_revenue - $shipping - $tax;
            
            $dataLayerDetails = "{
            'id': '". $this->jsQuoteEscape($order->getIncrementId()) ."',
            'affiliation': '". $this->jsQuoteEscape(Mage::app()->getStore()->getName()) ."',
            'revenue': '". $revenue ."',
            'shipping': '". $shipping ."',
            'tax': '". $tax ."',
            'total_revenue': '". $total_revenue ."',
            'currency': '". Mage::helper('googleanalyticsplus')->getTrackingCurrency($order) ."'
            }";
    }?>

   
    <script>
        /* <![CDATA[ */
        dataLayer = [<?php echo $dataLayerDetails?>];
        /* ]]> */
    </script>
    <?php echo $this->getTagManagerSnippet(); ?>
<?php endif; ?>
<?php /* @var $this Fooman_GoogleAnalyticsPlus_Block_TagManager */?>
<?php if ($this->shouldInclude()): ?>
   
   <?php $dataLayerDetails = "";
   	if($this->isSuccessPage()) {
   			$order = $this->_getOrder();
   			$shipping = Mage::helper('googleanalyticsplus')->convert($order, 'shipping_amount');
            $tax = Mage::helper('googleanalyticsplus')->convert($order, 'tax_amount');
            $total_revenue =  Mage::helper('googleanalyticsplus')->convert($order, 'grand_total');
            $revenue = $total_revenue - $shipping - $tax;
            
            $dataLayerDetails = "{
            'conversion_order_id': '". $this->jsQuoteEscape($order->getIncrementId()) ."',
            'conversion_store': '". $this->jsQuoteEscape(Mage::app()->getStore()->getName()) ."',
            'conversion_revenue_excl_taxship': '". $revenue ."',
            'conversion_revenue_shipping': '". $shipping ."',
            'conversion_revenue_tax': '". $tax ."',
            'conversion_revenue_revenue': '". $total_revenue ."',
            'conversion_currency': '". Mage::helper('googleanalyticsplus')->getTrackingCurrency($order) ."'
            }";
    }?>

   
    <script>
        /* <![CDATA[ */
        dataLayer = [<?php echo $dataLayerDetails?>];
        /* ]]> */
    </script>
    <?php echo $this->getTagManagerSnippet(); ?>
<?php endif; ?>
Remove TEST and name fields
Remove TEST and name fields
