Installing Tracking Tag in Magento

If you use Magento to host your online store, you'll need to correctly install the Perfect Audience site tracking tag before you can use Perfect Audience.

Note: Magento themes/skins can vary, and site variables for your particular skin may be different than what is listed here. If you need further assistance, please contact Magento's support or review their Knowledge Base for more help.

Installing the Tracking Tag

  1. Login to your Magento account. Navigate to your Admin panel and locate the "Miscellaneous HTML" section. You can paste the site tracking tag there.
  2. Head to your Magento site/skin files. Navigate to the path /app/design/frontend/default/yourskinname/template/checkout/success.phtml. Your skin/theme may contain several files named "success.phtml" so ensure you have selected the file your live site is using.
  3. Paste the following code in this file:
    <?php $order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
    $total = $order->getGrandTotal();?>
    <script type="text/javascript">
    window._pq = window._pq || [];
    _pq.push(['track', 'PurchasedItem', {orderId: "<?php echo $this->__($this->escapeHtml($this->getOrderId())) ?>", revenue: <?php echo $total ?>}])
    </script>
Then Save. Back in Perfect Audience, click Manage-> Create Conversion. Use the following settings:



Then save the conversion goal.

Wait for the e-mail! Now that your tag is on your Magento store, you will receive an e-mail when our system starts seeing data. You can also check back to the Site Tracking Tag page to see if data is being recived. This usually takes an hour or two. If you don't get an e-mail or see data on your tag page or Audiences page, double check that you've placed the tag in your web site code and pushed that code live. It can be easy to forget a simple step in there along the way.

Feedback and Knowledge Base