Post by Plugje » Mon Mar 16, 2015 5:56 am

I want to add a Google conversion code in the success page. But somehow this is not working anymore in OpenCart 2.x and I don't understand why.
This is the code I want to add at the bottom of the catalog/view/theme/default/template/common/success.tpl:

Code: Select all

<?php if (isset($this->request->get['route']) && $this->request->get['route'] == 'checkout/success') { ?>
    <!-- Conversion Code -->
    <script type="text/javascript">
    var google_conversion_id = 123456789;
    var google_conversion_language = "en";
    var google_conversion_format = "2";
    var google_conversion_color = "ffffff";
    var google_conversion_label = "AAAAAAAAAAAAAAAAAAA";
    var google_conversion_value = 0;
    </script>
    <script type="text/javascript" src="https://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/123456789/?label=AAAAAAAAAAAAAAAAAAA&guid=ON&script=0"/>
    </div>
    </noscript>
    <?php } ?>
Can somebody help me with this?

Newbie

Posts

Joined
Sat Oct 09, 2010 3:58 am

Post by DBI » Wed Apr 08, 2015 6:20 am

$this->request->get['route']
This is not populated (from the perspective of the success template) in OC 2.x

DBI
New member

Posts

Joined
Tue Oct 14, 2014 10:58 am
Who is online

Users browsing this forum: No registered users and 5 guests