I've been working with the reference checkout now for 5 or 6 months, and feel I have a pretty good grasp of how things work. By far the most common request I get is to set up analytics, particularly third-party conversion tracking systems like Adwords, Adroll, Adlucent, Barilliance, etc. Generally speaking, there are 2 use case scenarios for tracking during the reference checkout:
1. Google analytics mode - These tend to be traditional analytics systems that expect to have the script loaded as soon as possible, then track things like page views or events by calling their proprietary JavaScript functions in the code of the page. It is expected that the script will load on every page during checkout, With a variety of function calls used depending on the situation. For example, you might track a pageview and an event on the login/register page, and track a pageview and transaction on the order confirmation page. This is the scenario NetSuite has designed the tracking system for, and It works pretty well ( if a bit complex).
2. Conversion only tracker mode - This is by far the more common use case scenario. Most pay per click management tools or affiliate tracking systems only care about tracking the conversion, and they don't want to track anything until the conversion event occurs. These systems expect to have a few global JavaScript variables populated with things like the order ID and total, THEN load the script, which automatically triggers the tracking. This is the scenario that NetSuite does not seem to have planned for at all. By looking at the code within a tracking module, you might try to populate variables with order data within the load script method, but that always fails because those variables haven't been populated yet. The system is set up to load the scripts very early in the process, so any variables you try to define at that point would be undefined. You also can't use the load script method to load the script, as that gets called on every page during the checkout, which will send spurious conversion data to the tracking system.
Has anyone found a way to either load the script in the track transaction function, or some other workaround to get the 2nd use case scenario to function? NetSuite could have provided the perfect example in its reference Google Adwords tracking module, as it has the same use case scenario. Instead, they took the easy way out and merely load the no script pixel URL, bypassing the problem altogether. Unfortunately, not every tracking system has a no script pixel option, and it would be nice if NetSuite could address this large hole in functionality.