How To Setup Google Adwords Conversion Tracking in magento

Today One of  my  project i have added google  adwords. So i want to share this to everyone. this is very simple only two steps

One Step-01:

open this file

/app/design/frontend/default/yourskinname/template/checkout/success.phtml

then paste this code in the bottom of success.phtml file


<?php
 $order_details =  Mage::getModel(‘sales/order’)->loadByIncrementId(Mage::getSingleton(‘checkout/session’)->getLastRealOrderId());
 $adwords_saleamt = $order_details->subtotal;
 ?>

then login into google account

Under the “Reporting’ tab, click on “Conversions” and follow the steps to get the code that you’ll also need to add to the success.phtml page. It will look something like this:


<!– Google Code for Sale Conversion Page –>
 <script type=”text/javascript”>
 <!–
 var google_conversion_id = 0987654321;
 var google_conversion_language = “en”;
 var google_conversion_format = “3″;
 var google_conversion_color = “ffffff”;
 var google_conversion_label = “KFKFKFKFKFKF”;
 var google_conversion_value = 0;
 if (<?php echo $adwords_saleamt; ?>) {
 google_conversion_value = <?php echo $adwords_saleamt; ?>;
 }
 //–>
 </script>
 <script type=”text/javascript” src=”https://www.googleadservices.com/pagead/conversion.js”>
 </script>
 <noscript>
 <div style=”display:inline;”>
 <img height=”1″ width=”1″ style=”border-style:none;” alt=”"  src=”https://www.googleadservices.com/pagead/conversion/0987654321/?value=150&amp;label=KFKFKFKFKFKF&amp;guid=ON&amp;script=0″/>
 </div>
 </noscript>

now paste this getting code in the bottom of success.phtml page.

that okay and it is finished

 

for more magento tutorial visit: http://blog.free-extension.com/

Advertisements
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: