A comprehensive tagging strategy sets your campaign up for success and provides robust audience insights. The following instructions walk you through the process for placing Q Pixels for advanced conversion tracking in Opencart.
💡 Reminder:
|
⚠️ What you need to continue: Q Pixel (tag code available in the Q Pixel app within the Quantcast Platform) |
In This Article:
Q Pixel in Opencart
1. Open the success.php file found in /catalog/controller/checkout/success.php
2. Copy the following 2 lines:
$this->session->data['AddShoppersAmount'] = $this->cart->getTotal();
$this->session->data['AddShoppersOrderID'] = $this->session->data['order_id'];
3. Paste the two copied lines immediately after the line that reads:
“if (isset($this->session->data['order_id'])) {"
4. Open 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.
5. Get your account code from the Quantcast Platform (it begins with a “p-” prefix) and update the "qacct" field in the code. You can find the location for this code in the account code snippet below.
<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-xxxxxxxxxxxxx",
"labels": "_fp.event.PageView, _fp.event.Purchase"
"orderid": "AddShoppersOrderID",
"revenue": "AddShoppersAmount",
"event": "refresh"
});
</script>
6. Paste the updated script into the “success.tpl” file and save.
Verify Tag Implementation
The Quantcast Tag Inspector is a Google Chrome plugin that checks whether your Quantcast Tag and Audience Segments are implemented correctly. Install the Inspector to review individual pages of your site, and make sure the audience segments are firing correctly. For more information, see the Inspect Your Tag help document.
You are done! Please check the Q Pixel app to confirm that your tags are collecting data. If you are not seeing any activity, reach out to platform.support@quantcast.com or submit a Help Center request at www.quantcast.com. For more information on tagging, see our Tagging Overview article.