Interspire Shopping Cart Analytics Module Documentation
Interspire Shopping Cart 3.5 Required
This documentation has been written for the upcoming release of Interspire Shopping Cart 3.5. There are numerous changes between Interspire Shopping Cart 3.5 and earlier releases for modules.
Contents
Introduction
Analytics modules allow for additional analytics and visitor tracking applications to be integrated in to Interspire Shopping Cart. An analytics module can add tracking code to all pages of the store (in the top of the document) and it can also track conversions/purchases if it’s written to do so.
This document continues on from the Interspire Shopping Cart Modules Documentation which provides an overview of how Interspire Shopping Cart modules work and their structure.
Analytics modules exist within the /modules/analytics/ directory and extend upon the base ISC_ANALYTICS class.
Callbacks
GetTrackingCode
Returns: String containing the visitor tracking code.
If implemented, the GetTrackingCode method should return the tracking code to be inserted in the
section of every page on the store. This method should be implemented if you wish to integrate an analytics application that supports visitor tracking.GetConversionCode
Arguments:
- The total dollar amount of the order. ($orderTotal)
Returns: String containing the conversion tracking code.
If this analytics module supports conversion/purchase tracking, this method should be implemented in the module and should return the conversion tracking code that will be sent to the browser on the “Thank you for your order..” page. Typically most services require the order total (as to track order revenue from successful conversions) which is available as the first argument to the function. If more information is required (such as the order ID, customer details, items in the order etc) this may be obtained from the ISC_CLASS_ORDER->GetOrder() method as is outlined in the example below:
function GetConversionCode($orderTotal)
{
// Load up all of the information we have about this order
$order = $GLOBALS['ISC_CLASS_ORDER']->GetOrder();
$orderData = GetOrder($order['orderid']);
$conversionCode = "";
return $conversionCode;
}
