Jump to content

Google AdWords CONVERSION Tracking Code.


Recommended Posts

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

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

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

  • 1 month later...

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]





Do not copy and paste this code, use yours
(XXX is filled by adwords tracking numbers, do not modify your code)

Hope it helps.

  • Like 2
Link to comment
Share on other sites

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

  • 6 months later...
  • 2 weeks later...
  • 1 month later...
  • 4 weeks later...

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

  • 2 months later...
  • 2 weeks later...
  • 3 weeks later...
  • 1 month later...

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 by soniceb (see edit history)
Link to comment
Share on other sites

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 by soniceb (see edit history)
Link to comment
Share on other sites

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

  • 1 month later...

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.

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

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 by kikbo (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 4 months later...
  • 3 weeks later...

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

  • 2 weeks later...

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

  • 2 months later...
  • 1 year later...
  • 1 month later...
  • 9 months later...

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

×
×
  • Create New...