NetSuite integration
An integrated cloud business software suite, including business accounting, ERP, CRM and ecommerce software.
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.
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 id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></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.
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.
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 id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">
var itemsInOrder = "<%=getCurrentAttribute('confirmation','orderitems')%>";
var rows = itemsInOrder.split("||");
PostAffTracker.setAccountId('Account_ID');
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.
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 id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">
_nsCartModel.cart.items.each(function(item, index) {
PostAffTracker.setAccountId('Account_ID');
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.
The article discusses the integration method of Volusion API to track extended information for e-commerce solutions. It provides a hint on plugin setup and configuration, and related resources to get started. The website also promotes Post Affiliate Pro and offers free account sign up. Additionally, the article mentions how the dashboard is being built after the sign-up process, and provides different ways to contact the company for support.