Jump to content

Google Conversion Code GA


jkr

Recommended Posts

Hi, please where to put conversion code for Google Adwords?
 

I have tried to put it into the order-confirmation.tpl but the code does not appear there if I test it with my test orders.

Thank you

 

!-- Google Code  Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = XXX;
var google_conversion_label = "XXX";
var google_conversion_value = {$total};
var google_conversion_currency = "CZK";
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/XXX/?value={$total}&amp;currency_code=CZK&amp;label=xxx&amp;guid=ON&amp;script=0"/>
</div>
</noscript>

 

Link to comment
Share on other sites

1. Make sure your tracking code is being placed in the correct spot

Use your file manager (or via FTP) open the header.tpl file in the directory /themes/[yourtheme]/  

The Google analytics tracking code should go just before the </head> tag in the header.tpl file.

2. Surround your tracking code with the {literal} tags

PrestaShop uses the Smarty engine, and Smarty will try to interpret the curly brackets in your Google Analytics tracking code, resulting in an error. All you need to do is surround your tracking code with {literal} {/literal} like the example below, and that’s it. You’re done!


{literal}
<script>
(function(i,s,o,g,r,a,m)...

.
.
.
</script>
{/literal}

 

This is courtesy of purely.space

 

Link to comment
Share on other sites

Thank you

On 2/3/2018 at 7:00 PM, wayne_f said:

1. Make sure your tracking code is being placed in the correct spot

Use your file manager (or via FTP) open the header.tpl file in the directory /themes/[yourtheme]/  

The Google analytics tracking code should go just before the </head> tag in the header.tpl file.

2. Surround your tracking code with the {literal} tags

PrestaShop uses the Smarty engine, and Smarty will try to interpret the curly brackets in your Google Analytics tracking code, resulting in an error. All you need to do is surround your tracking code with {literal} {/literal} like the example below, and that’s it. You’re done!


{literal}
<script>
(function(i,s,o,g,r,a,m)...

.
.
.
</script>
{/literal}

 

This is courtesy of purely.space

 

 

Thank you

I have used the free module from here:

https://dh42.com/free-prestashop-modules/google-adword-conversion-tracking/

 

I do not know if it works properly, I will see after getting a conversion.

Link to comment
Share on other sites

  • 9 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...