Instructions for enhanced Quantcast conversion tracking on Opencart site:
- Open up the success.php file found in /catalog/controller/checkout/success.php
- Copy the following 2 lines and paste them immediately after the line that says
“if (isset($this->session->data['order_id'])) {"
$this->session->data['AddShoppersAmount'] = $this->cart->getTotal();
$this->session->data['AddShoppersOrderID'] = $this->session->data['order_id'];
- Open up the success.tpl file found in /catalog/view/theme/default/template/common/success.tpl
You will find the two lines of code that were just pasted here.
- Paste your Quantcast code in this file and save.
<!-- Start Quantcast Tag -->
<script type="text/javascript">
window._qevents = window._qevents || [];
(function() {
var elem = document.createElement('script');
elem.src = (document.location.protocol == "https:" ? "https://secure" : "http://edge") + ".quantserve.com/quant.js";
elem.async = true;
elem.type = "text/javascript";
var scpt = document.getElementsByTagName('script')[0];
scpt.parentNode.insertBefore(elem, scpt);
})();
window._qevents.push(
{qacct:"p-f2gP7ZgRJcDNg",labels:"_fp.event.Purchase Confirmation",orderid:" AddShoppersOrderID",revenue:"AddShoppersAmount"}
);
</script>
<noscript>
<img src="//pixel.quantserve.com/pixel/p-f2gP7ZgRJcDNg.gif?labels=_fp.event.Purchase+Confirmation&orderid=INSERT+ORDER+ID&revenue=INSERT+REVENUE" style="display: none;" border="0" height="1" width="1" alt="Quantcast"/>
</noscript>
<!-- End Quantcast tag -->