This integration method integrates Cart66 (WordPress plugin) receipt page.

1.

Sale tracking

The integration is pretty easy. The only step you have to take is to edit file wp-content/plugins/cart66/views/receipt.php and to find a line with this code:
if(Cart66Setting::getValue('enable_google_analytics') == 1 && $order->viewed == 0)

Now, copy the code below and paste it just above the mentioned line:

<!-- Post Affiliate Pro integration snippet -->
<script type="text/javascript">
	document.write(unescape("%3Cscript id=%27pap_x2s6df8d%27 src=%27" + (("https:" == document.location.protocol) ? "https://" : "http://") + "URL_TO_PostAffiliatePro/scripts/trackjs.js%27 type=%27text/javascript%27%3E%3C/script%3E"));
</script>
<script type="text/javascript">
PostAffTracker.setAccountId('Account_ID');
var sale = PostAffTracker.createSale();
sale.setTotalCost('<?php echo number_format($order->total, 2, ".", ""); ?>');
sale.setOrderID('<?php echo $order->trans_id; ?>');
sale.setProductID('<?php echo get_bloginfo("name"); ?>');
PostAffTracker.register();
</script>
<!-- /Post Affiliate Pro integration snippet -->

That's it. Save your changes. Now your system is integrated.

2.

Per product tracking

In case you want to track your orders per product, please use this code instead:

<!-- Post Affiliate Pro integration snippet -->
<script type="text/javascript">
	document.write(unescape("%3Cscript id=%27pap_x2s6df8d%27 src=%27" + (("https:" == document.location.protocol) ? "https://" : "http://") + "URL_TO_PostAffiliatePro/scripts/trackjs.js%27 type=%27text/javascript%27%3E%3C/script%3E"));
</script>
<script type="text/javascript">
PostAffTracker.setAccountId('Account_ID');
  <?php
  $i = 1;
  foreach ($order->getItems() as $item) {
  ?>
  echo "var sale$i = PostAffTracker.createSale();";
  echo "sale$i.setTotalCost('".$item->product_price * $item->quantity."');";
  echo "sale$i.setOrderID('".$order->trans_id."_".$i."');";
  echo "sale$i.setProductID('".$item->product_id."');";
  <?php
  }
  ?>
PostAffTracker.register();
</script>
<!-- /Post Affiliate Pro integration snippet -->

3.

Coupon tracking

In case you want to support coupon tracking, add this code to your sale tracking code:

<?php
if (!empty($order->coupon) && !empty($couponCodeUsed)) { 
  $coupons = explode(" (",$couponCodeUsed, 2);
  echo "sale.setCoupon('".$coupons[0]."');n";
}
?>

If you want to use discount amount in your sale tracking code for something, you can use this variable:
_$order->discountamount

4.

Cart66 on Cloud

In case you have the cloud-based Cart66 then the integration is possible too. You won't be able to track per product orders, but still you can track order subtotal and order ID. Add the following HTML tracking code to your thank you page:

<img src="//URL_TO_PostAffiliatePro/scripts/{$ImageTrackUrl}&TotalCost={{order_subtotal}}&OrderID={{order_number}}" width="1" height="1" />

That's it. Save your work and you are done.


Do not forget to integrate your WordPress with click tracking code.