dongzongzi0379 2012-09-21 12:29
浏览 27
已采纳

Google转化跟踪未注册动态值

I've been trying to set up conversion tracking on Magento 1.7. Here is my code for getting the dynamic value and adding it to the success.phtml page:

<?php $order = Mage::getSingleton('sales/order');
    $order->loadByIncrementID($this->getOrderId());
    $_totalData = $order->getData();
    $_grand = $_totalData['grand_total'];
    $_grand = number_format($_grand, 1, ".", "");
?>
<!-- Google Code for Successful transaction Conversion Page -->
<script type="text/javascript">
    /* <![CDATA[ */
    var google_conversion_id = XXXXXXXXXX;
    var google_conversion_language = "en";
    var google_conversion_format = "3";
    var google_conversion_color = "ffffff";
    var google_conversion_label = "XXXXXXXXXXX";
    var google_conversion_value = <?php echo $_grand; ?>;
    /* ]]> */
    </script>
    <script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
    <div style="display:inline;">
        <img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/XXXXXXXXXX/?value=<?php echo $_grand; ?>&amp;label=XXXXXXXXXX&amp;guid=ON&amp;script=0"/>
    </div>
</noscript>

This however does not work, despite having seen the code on the page with the correct value in it and everything. The only time Google actually registers the value is if it 10.0 and set as such in the Settings panel of the specific action in Google Conversions.

Can anybody maybe shed some light on this? Is there anything I might have missed or not set up?

Thanks in advance.

  • 写回答

1条回答 默认 最新

  • doujiao9574 2012-09-24 22:49
    关注

    Are you using magento build-in Google Analytics function in
    System -> Configuration -> Google API -> Google Analytics

    if so, then you could just link you google analytics and adwords account (without the need to add any custom code) read more @ http://support.google.com/adwords/bin/answer.py?hl=en&answer=2375435

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Oracle触发器记录修改前后的字段值
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器