Coding

Magento: Google Analytics Ecommerce tracking- success page

<?php // GET SOME VALUES FOR TRACKING PIXELS

    $_customerId = Mage::getSingleton('customer/session')->getCustomerId(); 
    $lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId(); 
    $order = Mage::getSingleton('sales/order'); 
    $order->load($lastOrderId); 
    $_totalData =$order->getData(); 
    $_sub = $_totalData['subtotal'];
    $_sub = round($_sub,2); 
?>
<!-- Google Code for Website XY Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = XXXXXXXXXX;
var google_conversion_language = "de";
var google_conversion_format = "2";
var google_conversion_color = "ffffff";
var google_conversion_label = "YYYYYYYYYYYYYYYY";
var google_conversion_value = <?php echo $_sub ?>;
var google_conversion_currency = "EUR";
var google_remarketing_only = false;
/* ]]> */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js"></script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/XXXXXXXXXX/?value=<?php echo $_sub ?>&amp;currency_code=EUR&amp;label=YYYYYYYYYYYYYYYY&amp;guid=ON&amp;script=0"/>
</div>
</noscript>

0 Bình luận

Trở về
  • HTML5 Canvas
  • HTML5 Canvas

     The <canvas> element is used to draw graphics, on the fly, on a web page. Draw a red rectangle, a gradient rectangle,...