...
On the order confirmation page, an OrderSummary orderSummary object is also available:
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
PF.OrderSummaryorderSummary.confirmation : int |
...
Integrating with 3rd-Party Shopping Cart Tracking Scripts
In order to register order completion with 3rd-party shopping cart tracking scripts, the ConfirmationExtra-mobile PagePart can be used. Within that PagePart, the PF.orderSummary object described above will be available for use.
If a 3rd-party integration includes a call to load an external script, that script will be loaded asynchronously meaning that any JS commands you place immediately afterwards may run before the script is actually loaded.
Code Block | ||||
---|---|---|---|---|
| ||||
<script type=text/javascript" src="//www.some-shopping-cart-tracker.com/script.js"></script> |
To combat this, you may need to wrap the subsequent integration code into an anonymous function that waits until the objects from the 3rd-party script are loaded and available to be used.
Here's an example that creates an anonymous function to check for the existence of the 3rd-party tracker's object ("MyTracker" in our example) and then calls the fictitious "TrackOrder" method passing along the order # and total.
Code Block | ||||
---|---|---|---|---|
| ||||
( function _trackerScript() {
if (typeof (MyTracker) == "undefined") {
setTimeout(function () { _trackerScript(); }, 500);
} else {
MyTracker.TrackOrder(PF.orderSummary.confirmation, PF.orderSummary.total);
}
})(); |
Scheduling Page Publishes
...