mytheory. Posted April 12, 2011 Share Posted April 12, 2011 Hi,As we all know marketing is a big aspect of any ecommerce business. We've started running some paid advertising campaigns, more specifically Google Adwords. Now, this is all good, but if we can't track our conversions from the PPC platform we are flying blind and won't be able to optimize our campaigns.So here's the question: how do you get the Adwords CONVERSION TRACKING CODE to work?!I took the code generated by Google (Adwords >> Reporting and Tools >> Conversion)... pasted in near the top of our order-confirmation.tpl file. And have waited. Our conversion stats show zeros across the board. And I know for a fact a couple of customers ordered this week having arrived from one of our google ads.I read somewhere else on the forum, and it seemed like most were saying to paste this code in the order-confirmation.tpl file so I did. Other than that, I haven't been able to find any other tips or instructions regarding this code.Please advise.THANKS! Link to comment Share on other sites More sharing options...
ChrisLNZ Posted April 12, 2011 Share Posted April 12, 2011 put it in the header.tpl or footer.tpl fileYou will need to use this to add your code : [removed] {literal} your content here {/literal} [removed] 1 Link to comment Share on other sites More sharing options...
mytheory. Posted April 12, 2011 Author Share Posted April 12, 2011 Hi ChrisLNZ,Thanks for you prompt reply! I really appreciate it!If I place this code in the header or footer... won't it count every visit as a conversion? Remember, I am only trying to see how many people who click on my google PPC ads actually end up placing an order. I am already tracking who and how they are getting to my site, and the CTR for each ad, but now I want to track the conversion (visitor buying something).Also, a part of your code was removed... is the first and last line supposed to read [script] ... [/script] ?? I will try placing the "literal" tags around the google conversion code on my order-confirmation.tpl file.Once again thanks! Link to comment Share on other sites More sharing options...
ChrisLNZ Posted April 12, 2011 Share Posted April 12, 2011 no code was missing you need the tags - removed and literalAs far as how the tracking goes - not sure - may result in all being tracked - why not try the code suggested to add the adwords code to to order-confirmation file? Link to comment Share on other sites More sharing options...
mytheory. Posted April 19, 2011 Author Share Posted April 19, 2011 Hi,Thanks ChrisLNZ for you input...So I've been periodically checking my adwords campaigns to see if any of these modifications have resulted in a conversion being tracked. Well today I found 1 set of data that proved that a conversion had been tracked (over the past week). So here's an update, not yet complete, but in case it can help somebody else.So at the creation of this thread (4/13/11) I had not seen any activity in my conversion data... so after posting here and using ChrisLNZ's recommendations I implemented the {literal} ... {/literal} tags around my entire conversion tracking code from google. And I waited. Today I noticed a conversion having been recorded from last week... so I managed to narrow down the day this was recorded. To my surprise it happened on 4/11/11, two days prior to me changing the code.I only have a small sample of data so I need to do further testing... but I reverted back to using Google's original code (without the {literal} tags). It seems like it takes some time (at least 24 hours) for conversion data to be recorded and reflected in my adwords account. Or maybe both instances of code works with and without the {literal} tags. Anyways, I've reverted to the original code used on the day the conversion was recorded... I will test further and report back with a more solid set of instructions on how to implement this code.Thanks again! Link to comment Share on other sites More sharing options...
Smart Modules Posted June 14, 2011 Share Posted June 14, 2011 We are testing google Adwords conversion code today, but we've made a little different changes:We do have google analytics plugin, (module folder called "GAnalytics") wich tells analytics that a order has been made. We did add some code to the /modules/ganalytics/header.tpl to be able to track the order total amount with both analytics and adwords, here is what we've done:At the end of /modules/ganalytics/header.tpl we added the first piece of adwords conversion code: <!-- Google Code for YOUR Conversion Page --> [removed] /* <![CDATA[ */ var google_conversion_id = XXXXXXXXXXXXX; var google_conversion_language = "XX"; var google_conversion_format = "X"; var google_conversion_color = "ffffff"; var google_conversion_label = "XXXXXXXXXXXXXXXXXX"; var google_conversion_value = {$trans.total}; /* ]]> */ [removed] Do not copy and paste this code, use yoursNote XXX are filled with your data, and the only line you should change is the var google_conversion_value one, removing the default 0 and adding {$trans.total};The other part of adwords code, as you and others suggested, in the your_theme/order-confirmation.tpl (also at the end of it): [removed] [removed] Do not copy and paste this code, use yours(XXX is filled by adwords tracking numbers, do not modify your code) Hope it helps. 2 Link to comment Share on other sites More sharing options...
mytheory. Posted June 14, 2011 Author Share Posted June 14, 2011 Hi Ancre!Wow! That's a great idea... to integrate it in with the Google Analytics module!So to clarify... the FIRST block of code goes into the google analytics module and the SECOND block of code goes in our order-confirmation.tpl file at the end?Do you have to implement BOTH of these codes... or can we just use the one with the google analytics module?ALSO, can you confirm that this works?? What version of PS are you using.. would it work on v1.4.2.5?MANY THANKS! Link to comment Share on other sites More sharing options...
Jovicyr Posted January 11, 2012 Share Posted January 11, 2012 Hi ! I'm interested in the answer of this post. How could we retrieve the total amount in confirmation page ? I tried with {$trans.total}; but it is not working. Any idea ? PS 1.4.3 Link to comment Share on other sites More sharing options...
need4speed Posted January 23, 2012 Share Posted January 23, 2012 Isnt it possible to insert the google conversion scripts manually ? Link to comment Share on other sites More sharing options...
need4speed Posted March 7, 2012 Share Posted March 7, 2012 I guess its easier just to buy the module from the addon store. Link to comment Share on other sites More sharing options...
chrisdata Posted April 3, 2012 Share Posted April 3, 2012 I guess its easier just to buy the module from the addon store. I don't think it's worth the $ for buying a module just for the conversion tracking code. Anyone has successfully setup this? 1 Link to comment Share on other sites More sharing options...
Ansl72 Posted April 4, 2012 Share Posted April 4, 2012 I don't think it's worth the $ for buying a module just for the conversion tracking code. Anyone has successfully setup this? I'm agree no one else has a solution and in what point of code (order-confirmation.tpl) have I to insert it? {* * 2007-2011 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <[email protected]> * @copyright 2007-2011 PrestaShop SA * @version Release: $Revision: 8088 $ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} {capture name=path}{l s='Order confirmation'}{/capture} {include file="$tpl_dir./breadcrumb.tpl"} <h1>{l s='Order confirmation'}</h1> {assign var='current_step' value='payment'} {include file="$tpl_dir./order-steps.tpl"} {include file="$tpl_dir./errors.tpl"} {$HOOK_ORDER_CONFIRMATION} {$HOOK_PAYMENT_RETURN} <br /> {if $is_guest} <p>{l s='Your order ID is:'} <span class="bold">{$id_order_formatted}</span> . {l s='Your order ID has been sent to your e-mail.'}</p> <a href="{$link->getPageLink('guest-tracking.php', true)}?id_order={$id_order}" title="{l s='Follow my order'}"><img src="{$img_dir}icon/order.gif" alt="{l s='Follow my order'}" class="icon" /></a> <a href="{$link->getPageLink('guest-tracking.php', true)}?id_order={$id_order}" title="{l s='Follow my order'}">{l s='Follow my order'}</a> {else} <a href="{$link->getPageLink('history.php', true)}" title="{l s='Back to orders'}"><img src="{$img_dir}icon/order.gif" alt="{l s='Back to orders'}" class="icon" /></a> <a href="{$link->getPageLink('history.php', true)}" title="{l s='Back to orders'}">{l s='Back to orders'}</a> {/if} Link to comment Share on other sites More sharing options...
kikbo Posted June 29, 2012 Share Posted June 29, 2012 Bumping this Link to comment Share on other sites More sharing options...
kikbo Posted July 7, 2012 Share Posted July 7, 2012 @Ansl72 shouldn't matter but I'd put it at the bottom after the {/if} {$trans.total} I'm going to see if that works... Link to comment Share on other sites More sharing options...
xoneproducts Posted July 29, 2012 Share Posted July 29, 2012 Excellent source of information thanks to you folks here. @mytheory. Have you implemented both codes? Have they been successful? @kikbo Do you mind reporting on your results? Link to comment Share on other sites More sharing options...
soniceb Posted August 30, 2012 Share Posted August 30, 2012 (edited) I've put the code at the end of my order-confirmation.tpl yesterday. But I don't know if it works because google takes at least a couple of days do elaborate the data in the adwords account. I had to add it between two {literal} {/literal} tags to let smarty compile it well, set force the module recompilation. lessee. Edited August 30, 2012 by soniceb (see edit history) Link to comment Share on other sites More sharing options...
soniceb Posted August 30, 2012 Share Posted August 30, 2012 (edited) I can't get the conversion value to work. I've tried with var google_conversion_value = { $trans.total }; Using Smarty 3 it's a good idea to surround the curly braces with spaces. Using Smarty <3 you have to use the {literal} tags. The problem is that if I look at the page confirmation php source code, after the order has been made, I see: var google_conversion_value={$trans.total}; exactly as in the tpl source code, meaning that the variable has not been converted to the actual order value. I'm not a php programmer, so I don't understand what happens here. It look like the variable has not been translated. Up in the code there's the correct order value already "exploded", that is translated: <span class="price">7,80 €</span> Any hints? Edited August 30, 2012 by soniceb (see edit history) Link to comment Share on other sites More sharing options...
alex69 Posted September 5, 2012 Share Posted September 5, 2012 Hello, I had integrated the conversion code with {$trans.total} and I have no problem to see the conversion on the source code and in Adwords. However, I don't want to have the total amount of the order, I want only the price of the products and, it's possible, without taxes. Any suggestions ? Thank you Link to comment Share on other sites More sharing options...
soniceb Posted September 5, 2012 Share Posted September 5, 2012 (edited) var google_conversion_value = {$cart->getOrderTotal(false, Cart::BOTH_WITHOUT_SHIPPING)}; Edited September 5, 2012 by soniceb (see edit history) Link to comment Share on other sites More sharing options...
alex69 Posted September 5, 2012 Share Posted September 5, 2012 Thanks sonicseb, when I put your line in the code instead of the standard google conversion_value line, the script do not work and the whole page stay blank, have you any idea why ? Link to comment Share on other sites More sharing options...
soniceb Posted September 5, 2012 Share Posted September 5, 2012 Which Prestashop version are you on? Are you using smarty2 or 3? I did this in 1.4.8.2 and smarty 3, and it works perfectly. If you're with 2 you should use the literal tags. Link to comment Share on other sites More sharing options...
alex69 Posted September 5, 2012 Share Posted September 5, 2012 I use Prestashop 1.4.8.2 and smarty 3. With the literal tag the script run, I will test an order trought the add to see if it's working in adwords. Thank you Link to comment Share on other sites More sharing options...
webplus Posted October 11, 2012 Share Posted October 11, 2012 Hi, instead of modifying order-confirmation.tpl and header.tpl, you can create a simple module (by cloning and cleaning the ganalytics module) and use hook $HOOK_ORDER_CONFIRMATION. Then you can simply use {$trans.total} in tpl file of this module in custom adwords script. 1 Link to comment Share on other sites More sharing options...
emresezgin Posted November 16, 2012 Share Posted November 16, 2012 Hi webplus, could you please explain your solution step by step thank you Link to comment Share on other sites More sharing options...
kikbo Posted November 19, 2012 Share Posted November 19, 2012 (edited) To get google adwords conversions to work paste the following code into this url: your_prestashop_folder/themes/prestashop/order-confirmation.tpl <!-- Google Code for prestapurchase Conversion Page --> <script type="text/javascript"> /* <![CDATA[ */ var google_conversion_id = THIS INFO COMES FROM YOUR GOOGLE ADWORDS ACCOUNT. TOOLS->CONVERSIONS-CODE; var google_conversion_language = THIS INFO COMES FROM YOUR GOOGLE ADWORDS ACCOUNT. TOOLS->CONVERSIONS-CODE; var google_conversion_format = THIS INFO COMES FROM YOUR GOOGLE ADWORDS ACCOUNT. TOOLS->CONVERSIONS-CODE; var google_conversion_color = THIS INFO COMES FROM YOUR GOOGLE ADWORDS ACCOUNT. TOOLS->CONVERSIONS-CODE; var google_conversion_label = THIS INFO COMES FROM YOUR GOOGLE ADWORDS ACCOUNT. TOOLS->CONVERSIONS-CODE; var google_conversion_value = THIS INFO COMES FROM YOUR GOOGLE ADWORDS ACCOUNT. TOOLS->CONVERSIONS-CODE; /* ]]> */ </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="THIS INFO COMES FROM YOUR GOOGLE ADWORDS ACCOUNT. TOOLS->CONVERSIONS-CODE"/> </div> </noscript> If you get fancy with "var google_conversion_value" your shop may not work. At least for me, using paypal external credit card processing, trying to use a prestashop variable for the total purchase value just stopped the conversion from working. The reason for this was, after the credit card had been processed and the customer had returned from Paypal to my website, Prestashop had emptied the customers cart. Prestashop "did not remember" what the customer had purchase, so the variable was null, and it broke my google conversion code. Also please note that this works for prestashop 1.47 I don't know about other versions, however IT SHOULD! Edited November 19, 2012 by kikbo (see edit history) 1 Link to comment Share on other sites More sharing options...
Berlindoor Posted March 27, 2013 Share Posted March 27, 2013 To get google adwords conversions to work paste the following code into this url: your_prestashop_folder/themes/prestashop/order-confirmation.tpl That is the original code of adwords conversion tracking btw. Link to comment Share on other sites More sharing options...
Nanuk Posted April 13, 2013 Share Posted April 13, 2013 Hi, the code with var google_conversion_value = {$trans.total}; seems to work, but in AdWords i can only see the conversion trought Paypal, if someone pays with Bank Wire AdWords won't count it. Any idea how to solve this? Thanks Link to comment Share on other sites More sharing options...
pel024 Posted April 23, 2013 Share Posted April 23, 2013 Hi, the code with var google_conversion_value = {$trans.total}; seems to work, but in AdWords i can only see the conversion trought Paypal, if someone pays with Bank Wire AdWords won't count it. Any idea how to solve this? Thanks @Nanuk Are you just adding the tracking code to your confirmation.tpl with var google_conversion_value = {$trans.total}; or are you also modifying the google analytics module as suggested in post #6? I'm getting confused! Cheers Link to comment Share on other sites More sharing options...
petete2008 Posted June 24, 2013 Share Posted June 24, 2013 there is some module? thank's Link to comment Share on other sites More sharing options...
benjamin utterback Posted June 24, 2013 Share Posted June 24, 2013 Hi petete2008, there are some modules that will do this for you. Here is the most popular one, http://addons.prestashop.com/en/analytics-stats-prestashop-modules/2165-adwords-conversion-tracking.html However, you should use the "Contact the Developer" button to find more about support from the creator of this module. Link to comment Share on other sites More sharing options...
petete2008 Posted June 25, 2013 Share Posted June 25, 2013 thank's Link to comment Share on other sites More sharing options...
fransjaeger Posted April 22, 2015 Share Posted April 22, 2015 There might be some issues when added G adwords conversion code - and move JS to bottomFound my fix herehttps://www.prestashop.com/forums/topic/368094-google-adwords-conversion-tracking-broken/ hope it helps Link to comment Share on other sites More sharing options...
leozao Posted June 12, 2015 Share Posted June 12, 2015 Yes, i discovered also that this is the problem...if you move JS to bottom... Link to comment Share on other sites More sharing options...
trevorgilligan Posted April 12, 2016 Share Posted April 12, 2016 We are testing google Adwords conversion code today, but we've made a little different changes: We do have google analytics plugin, (module folder called "GAnalytics") wich tells analytics that a order has been made. We did add some code to the /modules/ganalytics/header.tpl to be able to track the order total amount with both analytics and adwords, here is what we've done: At the end of /modules/ganalytics/header.tpl we added the first piece of adwords conversion code: <!-- Google Code for YOUR Conversion Page -->[removed]/* <![CDATA[ */var google_conversion_id = XXXXXXXXXXXXX;var google_conversion_language = "XX";var google_conversion_format = "X";var google_conversion_color = "ffffff";var google_conversion_label = "XXXXXXXXXXXXXXXXXX";var google_conversion_value = {$trans.total};/* ]]> */[removed] Do not copy and paste this code, use yours Note XXX are filled with your data, and the only line you should change is the var google_conversion_value one, removing the default 0 and adding {$trans.total}; The other part of adwords code, as you and others suggested, in the your_theme/order-confirmation.tpl (also at the end of it): [removed][removed]<noscript><div style="display:inline;"><img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"></div></noscript> Do not copy and paste this code, use yours(XXX is filled by adwords tracking numbers, do not modify your code) Hope it helps. hi thanks for this, im using prestashop 1.6 and there is no ganalytics/header.tpl there is only ganalytics/ganalytics.php, where would one past this in? thank you ganalytics... <!-- Google Code for YOUR Conversion Page --><![CDATA[ */var google_conversion_id = xxx ;var google_conversion_language = "en";var google_conversion_format = "3";var google_conversion_color = "ffffff";var google_conversion_label = "xxx";var google_conversion_value = {$trans.total};/* ]]> order-confirmation <noscript><div style="display:inline;"><img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/xxx/?value={$trans.total}&label=HhQcCNyfwmUQsZ_-yAM&guid=ON&script=0"></div></noscript> Link to comment Share on other sites More sharing options...
Recommended Posts