Google Adwords conversion not working

  • Thread starter Thread starter perpixon
  • Start date Start date
P

perpixon

Hi,

I am having trouble in getting the Google Adwords conversion tracking working. Looking on magento help forum pages I have found the following code:

<?php

$order_details = Mage::getModel('sales/order')->loadByIncrementId(Mage::getSingleton('checkout/session')->getLastRealOrderId());

$adwords_saleamt = $order_details->subtotal;

?>


Which needs to be added at the end of the success page, followed by the block of code Google give you.

The problem I have is when I add the above code the success page only half loads (I get the order number etc. but it dosnt display anything below the continue shopping button i.e. no footer).

I can just add the Google block of code on its own and the page works correctly but im not sure if it is actually reporting back to google. I have tried to make a fake transaction from the add but it is not appering in the conversion results.

What does the first bit of code do and do I need it?

Google Code

<!-- Google Code for Purchase Success Conversion Page -->

<script type="text/javascript">

/* <![CDATA[ */

var google_conversion_id = xxxxxxxxx;

var google_conversion_language = "en";

var google_conversion_format = "3";

var google_conversion_color = "ffffff";

var google_conversion_label = "07tpCxxxxxxxx2b_gM";

var google_conversion_value = 0;

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/10699xxxxxx4/?value=0&amp;label=07tpCLLxxxxxxxM2b_gM&amp;guid=ON&amp;script=0"/>

</div>

</noscript>
 
Hi thanks for that.

I have tries it and it no longer causes an error but I still do not get any conversions in Google adwords. The last one I had was when the code caused an error on the page. Im sure this must be a simple thing to do. I must be missing something (apart from a brain).
 
Upvote 0
Hi, yes its been 24 hours. The last reported conversion was 2 days ago when I originally tested the code I entered, but this stopped the page from fully loading. In case my test purchase was missed and no one has purchased via an adword I retried this morning but still nothing.
Thanks again.
 
Upvote 0

Latest Articles