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

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="//">
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//{$total_pay}&amp;currency_code={$currencyiso}&amp;label=ENTER_YOUR_LABEL_HERE&amp;guid=ON&amp;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….

Leave a Reply