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>
<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/ENTER_YOUR_ID_HERE/?value={$total_pay}&currency_code={$currencyiso}&label=ENTER_YOUR_LABEL_HERE&guid=ON&script=0"/>
</div>
</noscript>

in OrderConfirmationController.php add below in initContent function

        public function initContent()
        {
                parent::initContent();

                $this->context->smarty->assign(array(
                        '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);
$this->context->smarty->assign(array(
'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....

 

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