Jump to content

Help add Google Conversion Tracking Code to Order Confirmation


mariussky

Recommended Posts

Hello guys,

I searched everywhere but couldn't find a tutorial on how to add the Google Conversion Tracking Code to Order Confirmation page.

The code must be added inside <head></head> and ONLY on Order confirmation page, not the whole website.

Any ideas?

I tried the order-confirmation.tpl but that doesn't seem to add the code at all, or maybe I did something wrong.

I also added {literal}{/literal} to the code.

Link to comment
Share on other sites

I found the solution by myself.

 

To add any code to <head></head> to a specific page (this worked for order-confirmation.tpl) add:

{block name='hook_extra'}
{literal}
!!!ADD CODE HERE!!!
{/literal}
{/block}

 

The order-confirmation.tpl is located in (themes/YOUR_THEME/templates/checkout).

Don't forget to use the {block name='hook_extra'}{/block}.

Don't forget to use {literal} {/literal}.

You can place the entire code at the end of the file.

Edited by mariussky (see edit history)
  • Like 2
Link to comment
Share on other sites

If you don't use {literal} and just add the code to the file, it will generate an error and the site will stop working.

Literal works like <a> for adding a text. Basically you use literal to let Prestashop know that you entered a script and that script should be there and should work.

For a better explanation, ask a developer because I am not one and I can't really explain what it is. I can only let you know that you need to add literal in order for the script to be added and to work.

  • Thanks 1
Link to comment
Share on other sites

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...