An event-tracking builder for Magento that sends data to Listrak's API.
This module was developed to capture order information and send it to Listrak for reporting and workflow usage. Due to the complex field management process in some Listrak workflows, a corresponding interface was added to Magento to assist with mapping events to Listrak-specific fields.
Managing event tracking profiles
Configuring a profile
Using formatters to conform values to Listrak requirements
Configuring the integration
public function processEvent(Varien_Event_Observer $observer)
{
try {
$service = Mage::getSingleton('groove_listrakapi/service');
$event = $observer->getEvent()->getName();
$handlers = $this->_getEventHandlers();
$service->log("Processing event {$event} ...");
foreach ($handlers as $handler) {
if (strcasecmp($handler['event'], $event) === 0) {
foreach ($this->_getHandlerInstances($handler['type_id']) as $instance) {
$service->log("Executing handler #{$instance->getId()} ({$instance->getTypeId()}) ...");
$instance->import($observer->getEvent())
->send();
}
}
}
$service->log("Event processing complete.");
} catch (Exception $error) {
Mage::logException($error);
}
}