If you use Google Adwords advertising for your Magento web store, you will probably need this module. This module will be very useful, because Magento doesn’t have functionality for tracking Adowrds conversion. Feel free to download module and use it on personal responsibility. I’m using this module on web store without any problems.
You need to know that this module will track Adwords conversion over checkout/success page. At checkout/success page will be executed javascript (this is code of Block for checkout/success page):
< ?php
/**
*
* @category Inchoo
* @package Inchoo Google Adwords
* @author Domagoj Potkoc, Inchoo Team
*/
class Inchoo_Adwords_Block_Block extends Mage_Core_Block_Abstract
{
public function __construct()
{
parent::__construct();
$this->setGoogleConversionId(Mage::getStoreConfig('adwordsmodule/inchoad/google_conversion_id'));
$this->setGoogleConversionLanguage(Mage::getStoreConfig('adwordsmodule/inchoad/google_conversion_language'));
$this->setGoogleConversionFormat(Mage::getStoreConfig('adwordsmodule/inchoad/google_conversion_format'));
$this->setGoogleConversionColor(Mage::getStoreConfig('adwordsmodule/inchoad/google_conversion_color'));
$this->setGoogleConversionLabel(Mage::getStoreConfig('adwordsmodule/inchoad/google_conversion_label'));
}
protected function _toHtml()
{
$html = "";
if(Mage::helper('inchoo_adwords')->isTrackingAllowed()){
$this->setAmount(Mage::helper('inchoo_adwords')->getOrderTotal());
$html .= '
<!-- Google Code for Purchase Conversion Page -->
<script type="text/javascript">
/* < ![CDATA[ */
var google_conversion_id = '.$this->getGoogleConversionId().';
var google_conversion_language = "'.$this->getGoogleConversionLanguage().'";
var google_conversion_format = "'.$this->getGoogleConversionFormat().'";
var google_conversion_color = "'.$this->getGoogleConversionColor().'";
var google_conversion_label = "'.$this->getGoogleConversionLabel().'";
var google_conversion_value = 0;
if ('.$this->getAmount().') {
google_conversion_value = '.$this->getAmount().';
}
/* ]]> */
</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/'.$this-/>getGoogleConversionId().'/?value='.$this->getAmount().'&amp;amp;amp;amp;amp;label='.$this->getGoogleConversionLabel().'&amp;amp;amp;amp;amp;guid=ON&amp;amp;amp;amp;amp;script=0"/>
</div>
</noscript>';
}
return $html;
}
}
?>
Module has some config options which you need set over Magento admin section. Go to admin System -> Configure -> left tab: “Inchoo Extensions” -> Google Adwords.
You need set some data as: Google conversion id, Google conversion label and so on, if you use Adwords advertising I hope that you know this







Muchas gracias
Hi Domagoj,
Thanks for putting this together. I tried installing this module by copying all the files over in the same directory structure using my FTP client and everything seems to be copied properly over, but I don’t see the Inchoo tab in System-> Configuration. I’m using Magento CE 1.4.1.1 — is the module compatible with this version?
thanks,
Don
Hi dv
did you reload Magento cache??
Hi,
Thanks for checking in.
I thought I did that before w/out success but I did it again (did “Refresh” action on all Cache Types and then clicked the “Flush Magento Cache” button) and it’s all good now. Had some wonkiness initially (blank in the main content area when I clicked on the “Google Adwords” tab) but after logging out and back in it seemed ok.
I’ll put in my variables and see if the tracking works over the next few days. Thanks for your help!
-Don
Just what I was looking for, thanks a lot.
I had my own implementation, but without the admin interface, making it somewhat hard to maintain for the non-techies on the project
Great exactly what I was looking for to track my ROI on Adwords to Orders on my store. Thanks
Thanks, I’m sure we’ll put this to use next year.
We’re also after a Magento – Adwords extension that uses the Adwords API to assist the creation and management of large campaigns. I don’t see any module like this in Magento Connect which is surprising. Does anyone know of any kind of Adwords API module for Magento?
Hello —
Thanks for the module. It looks great. I was able to install it properly and enter in the proper values it’s expecting under Configuration, however the google code doesn’t appear in the success page, just the standard . Any ideas on what to do?
Thanks again,
Carlos
Oops –
I meant to say that just the standard Google Tracking appears in the success page, not the Adwords tracking code.
—- Carlos
hello,
Same here – after successful installation of your extension, I placed a live order in the store and the Adwords tracking code is not there. Would love for this to work, please reply.
thanks,
Craig
Sorry, what I meant more specifically in my last post is that the checkout/success page did not have the code in it after the order was placed.
Is this for Magento 1.4 only? I’m running 1.3.0 and definitely need something like this. I can’t seem to get it to work for 1.3.0. When I click on the tab, I just see a blank white body and all my left tabs disappear. Please let me know if there is a solution to 1.3.0
False alarm! I had to actually disable the cache. I’m not exactly sure why since I tried refreshing the cache, logging out and back in. Anyway, it’s up now. I’ve been having a hard time having my conversions read.
One last question: in Adwords, do I need to put the URL as https://…./success or http? I currently have it as https but I read that adwords won’t read that. Also, my success page doesn’t use the secure urls for css and js files. Is this normal? If not, is there a way to add the secure urls to the success page? All my other checkout pages work fine.
You guys are doing a fantastic job!
Sorry for the multiple comments, but I have the same issue as Craig. When checking the page source, I don’t see any adwords code. Only my analytics code.
Hi, great plugin! Well almost, I have the same problem as others – the tracking doesn’t work and when I check the page source it simply isn’t there.
It is as if the layout/inchoo_adwords.xml file is just ignored maybe?
Thanks for this extension! Do I need to enter a value in my AdWords-account settings to track the actual revenue? AdWords-suggest to enter a quanity to track the number of sales or an average ammount to give an average, but it’s also possible to track the actual sales with a specific value isn’t it?
Hi, I installed the plugin on magento version 1.4.2.0 and when i go to system>configuration I get the following error:
Fatal error: Class ‘Inchoo_Adwords_Helper_Data’ not found in /web/n3xt/mugman.be/www/app/Mage.php on line 520
Any idea how to fix this? All help will be appreciated!
Hi,
I got the same error when I try to install the modul:
Fatal error: Class ‘Inchoo_Adwords_Helper_Data’ not found in …../Mage.php on line 520
Any updates on this issue?
Hi,
It sounds very nice if it works the way that hold multiple Adwirds code.
Does it work like that?
Same error on ‘Inchoo_Adwords_Helper_Data’ magento 1.4.1.1
Regards
Update: you probably have your magento Compiler enabled. This has given me some problems before…
If you disable it it works.
I’m really interested in setting up adwords conversion tracking and I feel retarded for asking this, but I’m really confused.
1) Where do go to download the “module”
2) What does this code have to do with the module? are yo supposed to update the module with this code?
can this track the keyword to sku level conversion?
I’m also interested in setting up Adwords conversion tracking and would appreciate if you can answer Robbie questions above so I would be able to instal it in my site.
Rui, I tried calling and emailing these guys. They don’t answer. Turns out that Analytics Plus (Fooman) extension has adwords conversion built in. The only trick is that you have to edit the file ga-conversion.phtml var google_conversion_label = “Purchase”;
simply replace Purchase with the actual value that Google gives in their code snippet. It works, good luck.
Hi,
the tip with Compiler disable seems to work. Unfortunately I got another problem. When I select the extension in the back end I got a “access denied” error
What can I do ?
Hi guys. Will this work with ver. 1.6??
will this work with 1.6?
did anyone get this tracking conversions?
I was getting the same Inchoo_Adwords_Helper_Data’ error and I followed the advice on this post and disabled the compiler.
Now I get the following error
Parse error: syntax error, unexpected ‘}’, expecting ‘{‘ in /home/ABCD/public_html/shop/app/code/community/LUKA/GoogleAdWords/Helper/Data.php on line 39
Please let me know what needs to be done.
Hi,
Thanx for this module. It works for 1.7 also.
Couple of things to remind: if you do a view source on the success page, you won’t find the results. Please check http://stackoverflow.com/questions/12450659/google-adwords-convertion-tracking-in-magento-not-visible-in-view-source
Also, I’ve adapted the helper Data.php file, so that the subtotal_incl_tax is returned instead of the subtotal (necessary in my situation, could be different of course for other people).
Thanks again,
Tom
)
(not the same Tom as above
I’ve tried this on 1.7.0.2 and the tracking status of the conversion in Adwords never changes from Unverified. I’m using PayPal Express Checkout. Additionally, my Analytics Goal which has a Goal URL of /checkout/onepage/success never completes.
Weve packaged something similar for free, factors in the cookie options specified by the user to comply with new EU law http://www.magentocommerce.com/magento-connect/catalog/product/view/id/14817/
Works with 1.7.0.2 out of the box – only, if you’re using COMPILATION, remember to re-compile!! (I didn’t…)
I’m not able to get admin section to display all settings for that module (blank page) on Magento 1.4.1.1
Hi, would like to change your module to be able to handle local currencies, but I do not see the GA call _trackTrans..?
https://developers.google.com/analytics/devguides/collection/gajs/gaTrackingEcommerce#localcurrencies
What to do?