mariussky Posted July 28, 2022 Share Posted July 28, 2022 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 More sharing options...
mariussky Posted July 28, 2022 Author Share Posted July 28, 2022 (edited) 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 July 28, 2022 by mariussky (see edit history) 2 Link to comment Share on other sites More sharing options...
Ali Samie Posted July 29, 2022 Share Posted July 29, 2022 Thanks for sharing. Why did you use literal? What is the point? Link to comment Share on other sites More sharing options...
mariussky Posted July 29, 2022 Author Share Posted July 29, 2022 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. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now