Jump to content

How to guide to get google adwords to work with your prestashop

Recommended Posts

After googling I couldn't find any guide to get this to work. I had to piece together bunch of posts and spent a whole night of trial and error came up with this.


In order-confirmation.tpl add to the bottom and fill out your variables from your google adwords 

<!-- Google Code for Purchase Conversion Page -->
<script type="text/javascript">
{literal} /* <![CDATA[ */ {/literal}
var google_conversion_id = ENTER_YOUR_ID_HERE;
var google_conversion_language = "en";
var google_conversion_format = "2";
var google_conversion_color = "ffffff";
var google_conversion_label = "ENTER_YOUR_LABEL_HERE";
var google_conversion_value = {$total_pay};
var google_conversion_currency = "{$currencyiso}";
var google_remarketing_only = false;
{literal}/* ]]>*/ {/literal}
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/ENTER_YOUR_ID_HERE/?value={$total_pay}&currency_code={$currencyiso}&label=ENTER_YOUR_LABEL_HERE&guid=ON&script=0"/>

in OrderConfirmationController.php add below in initContent function

        public function initContent()

                        'is_guest' => $this->context->customer->is_guest,
                        'HOOK_ORDER_CONFIRMATION' => $this->displayOrderConfirmation(),
                        'HOOK_PAYMENT_RETURN' => $this->displayPaymentReturn()

$order = new Order($this->id_order);
$currency = new Currency($order->id_currency);
'total_pay' => $order->getOrdersTotalPaid(),
'currencyiso' => $currency->iso_code
                if ($this->context->customer->is_guest)

to test if this is working I used the google tag assistant chrome extension and made a bunch of orders using bankwire payment method.


Good luck....


Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More