With NetSuite, you can implement the complete business software suite to run your entire business better or begin with one module and add functionality as you need it.

The integration method uses an ability to display custom scripts on the thank you page. You can track subtotal, product info and order ID.

1.

Sale tracking code

Login to your NetSuite admin and navigate to Setup> Site Builder> Set Up Web site> Analytics tab. Insert the following code to the Order Confirmation Page section:

<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">
function triggerSaleTrack() {
    var rows = document.getElementById("ordersummary_total").parentNode.rows;
    for (var i=1; i<rows.length; i  ) {
      var category = "<%=getCurrentAttribute('site','name')%>";
      var productName = rows[i].cells[1].innerHTML;
      var orderId = '<%=getCurrentAttribute('confirmation','ordernumber')%>' '(' i ')';
      var quantity = rows[i].cells[3].innerHTML;
      var price = rows[i].cells[4].innerHTML;
      
      PostAffTracker.setAccountId('default1');
      var sale = PostAffTracker.createSale();
      sale.setTotalCost(price*quantity);
      sale.setOrderID(orderId);
      sale.setProductID(productName);
      sale.setData1(category);

      PostAffTracker.register();
    }
}
</script>

Save your changes.

2.

Trigger the sale tracking code

For now, we've defined the sale tracker in a special function, which we have to call from site footer. This is because some site elements are not loaded yet, that is why we will call it from the footer.

Navigate to Web site> Appearance> Themes and edit your actual theme. Click on the body subtab and scroll down to footer code which is at the bottom of the page. Please insert this code there:

<script type="text/javascript">
if (document.URL.indexOf("thanks") != -1) {
  triggerSaleTrack(); 
}
</script>

Save it and that's it.

3.

The latest version of Netsuite

In case you use the latest version of Netsuite, you have to use a bit different code. Login to your Netsuite admin and navigate to Setup> Site Builder> Set Up Web site> Analytics tab. Insert the following code to the Order Confirmation Page section:

<script type="text/javascript">
document.write(unescape("<script id='pap_x2s6df8d' src='"   (("https:" == document.location.protocol) ? "https://" : "http://")   "URL_TO_PostAffiliatePro/scripts/trackjs.js' type='text/javascript'></script>"));
</script>
<script type="text/javascript">
    var itemsInOrder = "<%=getCurrentAttribute('confirmation','orderitems')%>";
    var rows = itemsInOrder.split("||");
    

    for (var i=1; i<rows.length; i  ) {
      var item = rows[i].split("|");
      var orderId = "<%=getCurrentAttribute('confirmation','ordernumber')%>"   "("   i   ")";
      var price = item[3] * item[4];

      var sale = PostAffTracker.createSale();
      sale.setTotalCost(price);
      sale.setOrderID(orderId);
      sale.setProductID(item[0]);
      sale.setData1(item[2]);

      PostAffTracker.register();
    }
</script>

These are values of each order item:

item[0] = SKU

item[1] = item name

item[2] = item category

item[3] = price

item[4] = quantity

Save your work and you are done.

4.

One-Page Checkout feature

In case you wanted to integrate this new feature by NetSuite - One-Page Checkout, you can do it as well. This is the code you can use in your site.js file, in Custom/js folder.

<script type="text/javascript">
document.write(unescape("<script id='pap_x2s6df8d' src='"   (("https:" == document.location.protocol) ? "https://" : "http://")   "URL_TO_PostAffiliatePro/scripts/trackjs.js' type='text/javascript'></script>"));
</script>
<script type="text/javascript">
_nsCartModel.cart.items.each(function(item, index) {
  
  var sale = PostAffTracker.createSale();
  var price = parseFloat(item.price.substring(1));

  sale.setTotalCost(price*parseInt(item.quantity));
  sale.setOrderID(order.internalid);
  sale.setProductID(item.name);

  PostAffTracker.register();
}
);
</script>

In case you wanted to track category instead of (or in addition to) a product name, you can use variable 'category'. This variable can be used directly as it is initialized in SiteBuilder> Analytics tab.

Do not forget to integrate your main site with the click tracking code. Do not add it to your Netsuite admin panel as it might broke tracking.