Version Notes
Upgrade to support Respondr Analytics API v2
Download this release
Release Info
Developer | Respondr Inc. |
Extension | Respondr_Ecommerce |
Version | 2.0.0 |
Comparing to | |
See all releases |
Code changes from version 1.0.7 to 2.0.0
- app/code/community/RespondrMage/RespondrAnalytics/Block/Respondr.php +62 -123
- app/code/community/RespondrMage/RespondrAnalytics/Helper/Data.php +0 -30
- app/code/community/RespondrMage/RespondrAnalytics/controllers/IndexController.php +2 -25
- app/code/community/RespondrMage/RespondrAnalytics/etc/system.xml +1 -11
- app/design/frontend/base/default/template/respondranalytics/respondr.phtml +11 -65
- package.xml +9 -9
app/code/community/RespondrMage/RespondrAnalytics/Block/Respondr.php
CHANGED
@@ -24,10 +24,42 @@ class RespondrMage_RespondrAnalytics_Block_Respondr extends Mage_Core_Block_Temp
|
|
24 |
return $this->_getData('page_name');
|
25 |
}
|
26 |
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
protected function _getOrdersTrackingCode()
|
32 |
{
|
33 |
$orderIds = $this->getOrderIds();
|
@@ -37,52 +69,22 @@ class RespondrMage_RespondrAnalytics_Block_Respondr extends Mage_Core_Block_Temp
|
|
37 |
|
38 |
$collection = Mage::getResourceModel('sales/order_collection')
|
39 |
->addFieldToFilter('entity_id', array('in' => $orderIds));
|
40 |
-
$
|
41 |
-
|
42 |
foreach ($collection as $order) {
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
$
|
47 |
-
$_product = Mage::getModel('catalog/product')->load($product_id);
|
48 |
-
$cats = $_product->getCategoryIds();
|
49 |
-
$category_id = $cats[0]; // just grab the first id
|
50 |
-
$category = Mage::getModel('catalog/category')->load($category_id);
|
51 |
-
$category_name = $category->getName();
|
52 |
-
|
53 |
-
|
54 |
-
if ($item->getQtyOrdered()) {
|
55 |
-
$qty = number_format($item->getQtyOrdered(), 0, '.', '');
|
56 |
-
} else {
|
57 |
-
$qty = '0';
|
58 |
-
}
|
59 |
-
$result[] = sprintf("respondrTracker.addEcommerceItem( '%s', '%s', '%s', %s, %s);",
|
60 |
-
$this->jsQuoteEscape($item->getSku()),
|
61 |
-
$this->jsQuoteEscape($item->getName()),
|
62 |
-
$category_name,
|
63 |
-
$item->getBasePrice(),
|
64 |
-
$qty
|
65 |
-
);
|
66 |
-
|
67 |
-
}
|
68 |
-
foreach ($collection as $order) {
|
69 |
-
if ($order->getGrandTotal()) {
|
70 |
-
$subtotal = $order->getGrandTotal() - $order->getShippingAmount() - $order->getShippingTaxAmount();
|
71 |
-
} else {
|
72 |
-
$subtotal = '0.00';
|
73 |
-
}
|
74 |
-
$result[] = sprintf("respondrTracker.trackEcommerceOrder( '%s', %s, %s, %s, %s);",
|
75 |
-
$order->getIncrementId(),
|
76 |
-
$order->getBaseGrandTotal(),
|
77 |
-
$subtotal,
|
78 |
-
$order->getBaseTaxAmount(),
|
79 |
-
$order->getBaseShippingAmount()
|
80 |
-
);
|
81 |
-
|
82 |
-
|
83 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
}
|
85 |
-
return implode("\n", $result);
|
86 |
}
|
87 |
|
88 |
/**
|
@@ -111,60 +113,9 @@ class RespondrMage_RespondrAnalytics_Block_Respondr extends Mage_Core_Block_Temp
|
|
111 |
if ($cartitem->getPrice() == 0 || $cartitem->getPrice() < 0.00001):
|
112 |
continue;
|
113 |
endif;
|
114 |
-
echo '
|
115 |
echo "\n";
|
116 |
}
|
117 |
-
|
118 |
-
//total in cart
|
119 |
-
$grandTotal = Mage::getModel('checkout/cart')->getQuote()->getGrandTotal();
|
120 |
-
if ($grandTotal == 0) echo ''; else
|
121 |
-
echo 'respondrTracker.trackEcommerceCartUpdate(' . $grandTotal . ');';
|
122 |
-
echo "\n";
|
123 |
-
}
|
124 |
-
|
125 |
-
/**
|
126 |
-
* Render information when product page view
|
127 |
-
* http://piwik.org/docs/ecommerce-analytics/
|
128 |
-
*/
|
129 |
-
protected function _getProductPageview()
|
130 |
-
{
|
131 |
-
|
132 |
-
$currentproduct = Mage::registry('current_product');
|
133 |
-
|
134 |
-
if (!($currentproduct instanceof Mage_Catalog_Model_Product)) {
|
135 |
-
return;
|
136 |
-
}
|
137 |
-
|
138 |
-
|
139 |
-
$product_id = $currentproduct->getId();
|
140 |
-
$_product = Mage::getModel('catalog/product')->load($product_id);
|
141 |
-
$cats = $_product->getCategoryIds();
|
142 |
-
$category_id = $cats[0]; // just grab the first id
|
143 |
-
//$category_id = if (isset($cats[0]) {$category_id = $cats[0]} else $category_id = null; potential fix when no catgeories
|
144 |
-
$category = Mage::getModel('catalog/category')->load($category_id);
|
145 |
-
$category_name = $category->getName();
|
146 |
-
$product = $currentproduct->getName();
|
147 |
-
//$product = str_replace('"', "", $product);
|
148 |
-
//$description = str_replace('"', "", $_product->getDescription());
|
149 |
-
$description = "";
|
150 |
-
|
151 |
-
echo 'respondrTracker.setEcommerceView("' . $this->jsQuoteEscape($currentproduct->getSku()) . '", "' . $this->jsQuoteEscape($product) . '","' . $this->jsQuoteEscape($category_name) . '",' . $currentproduct->getPrice() . ',"'. $_product->getImageUrl() . '","'. $this->jsQuoteEscape($description) .'");';
|
152 |
-
Mage::unregister('current_category');
|
153 |
-
}
|
154 |
-
|
155 |
-
/**
|
156 |
-
* Render information of category view
|
157 |
-
* http://piwik.org/docs/ecommerce-analytics/
|
158 |
-
*/
|
159 |
-
protected function _getCategoryPageview()
|
160 |
-
{
|
161 |
-
$currentcategory = Mage::registry('current_category');
|
162 |
-
|
163 |
-
if (!($currentcategory instanceof Mage_Catalog_Model_Category)) {
|
164 |
-
return;
|
165 |
-
}
|
166 |
-
echo 'respondrTracker.setEcommerceView(false,false,"' . $currentcategory->getName() . '",false,false);';
|
167 |
-
Mage::unregister('current_product');
|
168 |
}
|
169 |
|
170 |
/**
|
@@ -174,31 +125,23 @@ class RespondrMage_RespondrAnalytics_Block_Respondr extends Mage_Core_Block_Temp
|
|
174 |
*/
|
175 |
protected function _getUser() {
|
176 |
|
177 |
-
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
178 |
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
179 |
$customerAddressId = Mage::getSingleton('customer/session')->getCustomer()->getDefaultBilling();
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
|
|
|
|
184 |
if ($customerAddressId){
|
185 |
$address = Mage::getModel('customer/address')->load($customerAddressId);
|
186 |
-
|
187 |
-
|
188 |
}
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
}
|
193 |
-
|
194 |
-
protected function _getOptinStatus() {
|
195 |
-
|
196 |
-
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
197 |
-
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
198 |
-
$optin = Mage::helper('respondranalytics')->isCustomerSubscribed($customer->getData("email"));
|
199 |
-
echo 'respondrTracker.setCustomVariable (10, "optin", "'.$optin.'", scope = "visit");';
|
200 |
-
}
|
201 |
-
|
202 |
|
203 |
}
|
204 |
|
@@ -209,10 +152,6 @@ class RespondrMage_RespondrAnalytics_Block_Respondr extends Mage_Core_Block_Temp
|
|
209 |
*/
|
210 |
protected function _toHtml()
|
211 |
{
|
212 |
-
if (!Mage::helper('respondranalytics')->isRespondrAnalyticsAvailable()) {
|
213 |
-
return '';
|
214 |
-
}
|
215 |
-
|
216 |
return parent::_toHtml();
|
217 |
}
|
218 |
}
|
24 |
return $this->_getData('page_name');
|
25 |
}
|
26 |
|
27 |
+
protected function _getPageview()
|
28 |
+
{
|
29 |
+
|
30 |
+
$currentproduct = Mage::registry('current_product');
|
31 |
+
$currentcategory = Mage::registry('current_category');
|
32 |
+
// is this a product view
|
33 |
+
if ($currentproduct instanceof Mage_Catalog_Model_Product) {
|
34 |
+
$product_id = $currentproduct->getId();
|
35 |
+
$_product = Mage::getModel('catalog/product')->load($product_id);
|
36 |
+
$cats = $_product->getCategoryIds();
|
37 |
+
$category_id = $cats[0]; // just grab the first id
|
38 |
+
$category = Mage::getModel('catalog/category')->load($category_id);
|
39 |
+
$category_name = $category->getName();
|
40 |
+
$product = $currentproduct->getName();
|
41 |
+
//$description = str_replace('"', "", $_product->getDescription());
|
42 |
+
$description = "";
|
43 |
+
|
44 |
+
echo '_raq.push(["trackProductView", {sku: "' . $this->jsQuoteEscape($this->jsQuoteEscape($currentproduct->getSku()), '"') . '", name: "' . $this->jsQuoteEscape($this->jsQuoteEscape($product), '"') . '", categories: "' . $this->jsQuoteEscape($category_name) . '", price: ' . $currentproduct->getPrice() . ', imageUrl: "'. $_product->getImageUrl() . '", desc: "'. $this->jsQuoteEscape($description) .'"}]);';
|
45 |
+
Mage::unregister('current_category');
|
46 |
+
|
47 |
+
// is this a category view
|
48 |
+
} elseif($currentcategory instanceof Mage_Catalog_Model_Category) {
|
49 |
+
echo '_raq.push(["trackCategoryView", {name: "' . $currentcategory->getName() . '"}]);';
|
50 |
+
Mage::unregister('current_product');
|
51 |
+
|
52 |
+
// is this a search
|
53 |
+
} elseif (false) {
|
54 |
+
|
55 |
+
// default to page view
|
56 |
+
} else {
|
57 |
+
$title = $this->getLayout()->getBlock('head')->getTitle();
|
58 |
+
echo '_raq.push(["trackPageView", {pageTitle: "' . $title . '"}]);';
|
59 |
+
}
|
60 |
+
|
61 |
+
}
|
62 |
+
|
63 |
protected function _getOrdersTrackingCode()
|
64 |
{
|
65 |
$orderIds = $this->getOrderIds();
|
69 |
|
70 |
$collection = Mage::getResourceModel('sales/order_collection')
|
71 |
->addFieldToFilter('entity_id', array('in' => $orderIds));
|
72 |
+
$obj = '';
|
|
|
73 |
foreach ($collection as $order) {
|
74 |
+
if ($order->getGrandTotal()) {
|
75 |
+
$subtotal = $order->getGrandTotal() - $order->getShippingAmount() - $order->getShippingTaxAmount();
|
76 |
+
} else {
|
77 |
+
$subtotal = '0.00';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
}
|
79 |
+
$obj = '_raq.push(["trackEcommerceOrder", {' .
|
80 |
+
'id: "' . $order->getIncrementId() .'",' .
|
81 |
+
'total: ' . $order->getBaseGrandTotal() .',' .
|
82 |
+
'subTotal: ' . $subtotal .',' .
|
83 |
+
'tax: ' . $order->getBaseTaxAmount() .',' .
|
84 |
+
'shipping: ' . $order->getBaseShippingAmount();
|
85 |
+
$obj = $obj . '}]);';
|
86 |
+
echo $obj;
|
87 |
}
|
|
|
88 |
}
|
89 |
|
90 |
/**
|
113 |
if ($cartitem->getPrice() == 0 || $cartitem->getPrice() < 0.00001):
|
114 |
continue;
|
115 |
endif;
|
116 |
+
echo '_raq.push(["updateEcommerceItem", {sku: "' . $cartitem->getSku() . '", name: "' . $nameofproduct . '", categories: "' . $category_name . '", price: ' . $cartitem->getPrice() . ', qty: ' . $cartitem->getQty() . '}]);';
|
117 |
echo "\n";
|
118 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
}
|
120 |
|
121 |
/**
|
125 |
*/
|
126 |
protected function _getUser() {
|
127 |
|
128 |
+
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
|
129 |
$customer = Mage::getSingleton('customer/session')->getCustomer();
|
130 |
$customerAddressId = Mage::getSingleton('customer/session')->getCustomer()->getDefaultBilling();
|
131 |
+
|
132 |
+
$obj = '_raq.push(["saveContact", {' .
|
133 |
+
'email: "' . $customer->getData("email") .'",' .
|
134 |
+
'firstName: "' . $customer->getData("firstname") .'",' .
|
135 |
+
'lastName: "' . $customer->getData("lastname") .'"';
|
136 |
+
|
137 |
if ($customerAddressId){
|
138 |
$address = Mage::getModel('customer/address')->load($customerAddressId);
|
139 |
+
$obj = $obj . ', company: "' . $address->getData("company") . '",' .
|
140 |
+
'phone: "' . $address->getData("telephone") . '"';
|
141 |
}
|
142 |
+
$obj = $obj . '}]);';
|
143 |
+
echo $obj;
|
144 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
145 |
|
146 |
}
|
147 |
|
152 |
*/
|
153 |
protected function _toHtml()
|
154 |
{
|
|
|
|
|
|
|
|
|
155 |
return parent::_toHtml();
|
156 |
}
|
157 |
}
|
app/code/community/RespondrMage/RespondrAnalytics/Helper/Data.php
CHANGED
@@ -15,35 +15,5 @@ class RespondrMage_RespondrAnalytics_Helper_Data extends Mage_Core_Helper_Abstra
|
|
15 |
/**
|
16 |
* Config paths for using throughout the code
|
17 |
*/
|
18 |
-
const XML_PATH_ACTIVE = 'respondr/analytics/active';
|
19 |
const XML_PATH_SITE = 'respondr/analytics/site';
|
20 |
-
const XML_PATH_PWTOKEN = 'respondr/analytics/pwtoken';
|
21 |
-
|
22 |
-
// hard-code Respondr URL
|
23 |
-
const SERVER_URL = 'http://analytics.respondr.io';
|
24 |
-
|
25 |
-
|
26 |
-
/**
|
27 |
-
*
|
28 |
-
* @param mixed $store
|
29 |
-
* @return bool
|
30 |
-
*/
|
31 |
-
public function isRespondrAnalyticsAvailable($store = null)
|
32 |
-
{
|
33 |
-
$siteId = Mage::getStoreConfig(self::XML_PATH_SITE, $store);
|
34 |
-
return $siteId && Mage::getStoreConfigFlag(self::XML_PATH_ACTIVE, $store);
|
35 |
-
}
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Check the customer's newsletter optin status
|
39 |
-
* @return string
|
40 |
-
*/
|
41 |
-
public function isCustomerSubscribed($email) {
|
42 |
-
$subscriber = Mage::getModel('newsletter/subscriber')->loadByEmail($email);
|
43 |
-
if($subscriber->getId()) {
|
44 |
-
return $subscriber->getData('subscriber_status') == Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED;
|
45 |
-
} else {
|
46 |
-
return 0;
|
47 |
-
}
|
48 |
-
}
|
49 |
}
|
15 |
/**
|
16 |
* Config paths for using throughout the code
|
17 |
*/
|
|
|
18 |
const XML_PATH_SITE = 'respondr/analytics/site';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
}
|
app/code/community/RespondrMage/RespondrAnalytics/controllers/IndexController.php
CHANGED
@@ -13,30 +13,7 @@
|
|
13 |
|
14 |
class RespondrMage_RespondrAnalytics_IndexController extends Mage_Adminhtml_Controller_Action
|
15 |
{
|
16 |
-
public function indexAction()
|
17 |
-
|
18 |
-
|
19 |
-
$this->loadLayout();
|
20 |
-
|
21 |
-
$active = Mage::getStoreConfig(RespondrMage_RespondrAnalytics_Helper_Data::XML_PATH_ACTIVE);
|
22 |
-
$siteId = Mage::getStoreConfig(RespondrMage_RespondrAnalytics_Helper_Data::XML_PATH_SITE);
|
23 |
-
$pwtoken= Mage::getStoreConfig(RespondrMage_RespondrAnalytics_Helper_Data::XML_PATH_PWTOKEN);
|
24 |
-
|
25 |
-
$installPath = RespondrMage_RespondrAnalytics_Helper_Data::SERVER_URL;
|
26 |
-
/*
|
27 |
-
if (!empty($pwtoken)){
|
28 |
-
$block = $this->getLayout()->createBlock('core/text', 'respondr-block')->setText('<iframe src="'.$installPath.'/index.php?module=Widgetize&action=iframe&moduleToWidgetize=Dashboard&actionToWidgetize=index&idSite='.$siteId.'&period=week&date=yesterday&token_auth='.$pwtoken.'" frameborder="0" marginheight="0" marginwidth="0" width="100%" height="1000px"></iframe>');
|
29 |
-
$this->_addContent($block);
|
30 |
-
$this->_setActiveMenu('respondr_menu')->renderLayout();
|
31 |
-
}
|
32 |
-
|
33 |
-
|
34 |
-
if (empty($pwtoken)){
|
35 |
-
$block = $this->getLayout()->createBlock('core/text', 'respondr-block')->setText('You are missing your Piwik Token Auth Key. Get it from your API tab in your Piwik Install.');
|
36 |
-
$this->_addContent($block);
|
37 |
-
$this->_setActiveMenu('respondr_menu')->renderLayout();
|
38 |
-
}
|
39 |
-
|
40 |
}
|
41 |
-
*/
|
42 |
}
|
13 |
|
14 |
class RespondrMage_RespondrAnalytics_IndexController extends Mage_Adminhtml_Controller_Action
|
15 |
{
|
16 |
+
public function indexAction() {
|
17 |
+
$this->loadLayout();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
}
|
|
|
19 |
}
|
app/code/community/RespondrMage/RespondrAnalytics/etc/system.xml
CHANGED
@@ -26,22 +26,12 @@
|
|
26 |
<analytics translate="label">
|
27 |
<label>Settings</label>
|
28 |
<frontend_type>text</frontend_type>
|
29 |
-
<comment>Don't have a Respondr account?
|
30 |
<sort_order>10</sort_order>
|
31 |
<show_in_default>1</show_in_default>
|
32 |
<show_in_website>1</show_in_website>
|
33 |
<show_in_store>1</show_in_store>
|
34 |
<fields>
|
35 |
-
<active translate="label">
|
36 |
-
<label>Enable</label>
|
37 |
-
<frontend_type>select</frontend_type>
|
38 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
39 |
-
<sort_order>10</sort_order>
|
40 |
-
<show_in_default>1</show_in_default>
|
41 |
-
<show_in_website>1</show_in_website>
|
42 |
-
<show_in_store>1</show_in_store>
|
43 |
-
</active>
|
44 |
-
|
45 |
<site translate="label">
|
46 |
<label>Site Id</label>
|
47 |
<frontend_type>text</frontend_type>
|
26 |
<analytics translate="label">
|
27 |
<label>Settings</label>
|
28 |
<frontend_type>text</frontend_type>
|
29 |
+
<comment>Don't have a Respondr account? <![CDATA[<a href="https://signup.respondr.io/" target="_blank">Sign up</a>.]]></comment>
|
30 |
<sort_order>10</sort_order>
|
31 |
<show_in_default>1</show_in_default>
|
32 |
<show_in_website>1</show_in_website>
|
33 |
<show_in_store>1</show_in_store>
|
34 |
<fields>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
<site translate="label">
|
36 |
<label>Site Id</label>
|
37 |
<frontend_type>text</frontend_type>
|
app/design/frontend/base/default/template/respondranalytics/respondr.phtml
CHANGED
@@ -11,77 +11,23 @@
|
|
11 |
*
|
12 |
*/
|
13 |
?>
|
14 |
-
<?php if (!Mage::helper('core/cookie')->isUserNotAllowSaveCookie()): ?>
|
15 |
<?php $siteId = Mage::getStoreConfig(RespondrMage_RespondrAnalytics_Helper_Data::XML_PATH_SITE) ?>
|
16 |
-
<?php $installPath = RespondrMage_RespondrAnalytics_Helper_Data::SERVER_URL ?>
|
17 |
-
|
18 |
-
<?php
|
19 |
-
|
20 |
-
if ($siteId) {
|
21 |
-
if (strpos($installPath, "https://") !== false) {
|
22 |
-
$secureinstallPath = $installPath;
|
23 |
-
$installPath = str_replace("https://", "http://", $installPath);
|
24 |
-
}
|
25 |
-
if (strpos($installPath, "http://") === false)
|
26 |
-
$installPath = "http://" . $installPath;
|
27 |
-
|
28 |
-
$secureinstallPath = str_replace("http://", "https://", $installPath);
|
29 |
-
|
30 |
-
$last = $installPath[strlen($installPath)-1];
|
31 |
-
|
32 |
-
if ($last != "/") {
|
33 |
-
$installPath .= "/";
|
34 |
-
$secureinstallPath .= "/";
|
35 |
-
}
|
36 |
-
?>
|
37 |
-
|
38 |
-
<?php
|
39 |
-
//0 Search Results
|
40 |
-
if($this->getRequest()->getControllerName()=='result')
|
41 |
-
{
|
42 |
-
$nores = Mage::helper('catalogsearch')->getEngine()->getResultCollection()->addSearchFilter(Mage::helper('catalogsearch')->getQuery()->getQueryText())->getSize();
|
43 |
-
}?>
|
44 |
-
|
45 |
-
|
46 |
|
47 |
<!-- RESPONDR TRACKING CODE -->
|
48 |
<script type="text/javascript">
|
49 |
//<![CDATA[
|
50 |
-
|
51 |
-
var
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
var
|
|
|
|
|
|
|
56 |
<?php echo $this->_getEcommerceCartUpdate()?>
|
57 |
<?php echo $this->_getOrdersTrackingCode()?>
|
58 |
-
<?php echo $this->
|
59 |
-
<?php
|
60 |
-
<?php echo $this->_getUser()?> // added by Respondr
|
61 |
-
<?php echo $this->_getOptinStatus()?> // added by Respondr
|
62 |
-
<?php if (isset($nores))
|
63 |
-
{?>
|
64 |
-
var searchCount = <? echo $nores?>;
|
65 |
-
respondrTracker.setCustomUrl(document.URL + '&search_count=' + searchCount);
|
66 |
-
<?php }?>
|
67 |
-
|
68 |
-
<?php
|
69 |
-
//404 tracking
|
70 |
-
$action = Mage::app()->getRequest()->getActionName();
|
71 |
-
if($action == 'noRoute'){?>
|
72 |
-
respondrTracker.setDocumentTitle('404/URL = '+String(document.location.pathname+document.location.search).replace(/\//g,"%2f") + '/From = ' + String(document.referrer).replace(/\//g,"%2f"));
|
73 |
-
<?php }?>
|
74 |
-
|
75 |
-
<?php echo "\n";?>
|
76 |
-
respondrTracker.trackPageView();
|
77 |
-
respondrTracker.enableLinkTracking();
|
78 |
-
} catch( err ) {}
|
79 |
//]]>
|
80 |
</script>
|
81 |
-
<noscript><p><img src="<?php echo $installPath ?>respondr.php?idsite=<?php echo $siteId ?>" style="border:0" alt="" /></p></noscript>
|
82 |
-
<!-- END RESPONDR TRACKING CODE -->
|
83 |
-
|
84 |
-
<?php } ?>
|
85 |
-
<?php endif; ?>
|
86 |
-
|
87 |
-
|
11 |
*
|
12 |
*/
|
13 |
?>
|
|
|
14 |
<?php $siteId = Mage::getStoreConfig(RespondrMage_RespondrAnalytics_Helper_Data::XML_PATH_SITE) ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
<!-- RESPONDR TRACKING CODE -->
|
17 |
<script type="text/javascript">
|
18 |
//<![CDATA[
|
19 |
+
<?php if ($siteId) { ?>
|
20 |
+
var _raq = _raq || [];
|
21 |
+
_raq.push(["trackSession", "<?php echo $siteId ?>"]);
|
22 |
+
(function() {
|
23 |
+
var u=(("https:" == document.location.protocol) ? "https" : "http") + "://analytics.respondr.io/static/";
|
24 |
+
var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
|
25 |
+
g.defer=true; g.async=true; g.src=u+"respondr.js"; s.parentNode.insertBefore(g,s);
|
26 |
+
})();
|
27 |
+
<?php echo $this->_getPageview()?>
|
28 |
<?php echo $this->_getEcommerceCartUpdate()?>
|
29 |
<?php echo $this->_getOrdersTrackingCode()?>
|
30 |
+
<?php echo $this->_getUser()?>
|
31 |
+
<?php } ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
//]]>
|
33 |
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Respondr_Ecommerce</name>
|
4 |
-
<version>
|
5 |
<stability>stable</stability>
|
6 |
-
<license
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>
|
10 |
-
<description>Increase your online revenue with automated email, mobile, and social messaging driven by your web analytics. Respondr makes it easy to re-engage your customers and bring them back to your store. Creating and managing abandoned cart, product recommendation, and cross-sell email marketing has never been easier. You can also send coupons and promotions via SMS/MMS, Facebook and more!</description>
|
11 |
-
<notes>
|
12 |
-
<authors><author><name>
|
13 |
-
<date>
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="RespondrMage"><dir name="RespondrAnalytics"><dir name="Block"><file name="Respondr.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Respondr_Ecommerce</name>
|
4 |
+
<version>2.0.0</version>
|
5 |
<stability>stable</stability>
|
6 |
+
<license>GPL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>CRM and marketing automation for e-commerce. Send personalized messages to your users based on their actions.</summary>
|
10 |
+
<description>Respondr is a B2C CRM with powerful e-commerce features, including marketing automation and e-commerce analytics. Increase your online revenue with automated email, mobile, and social messaging driven by your web analytics. Respondr makes it easy to re-engage your customers and bring them back to your store. Creating and managing abandoned cart, product recommendation, and cross-sell email marketing has never been easier. You can also send coupons and promotions via SMS/MMS, Facebook and more!</description>
|
11 |
+
<notes>Upgrade to support Respondr Analytics API v2</notes>
|
12 |
+
<authors><author><name>Respondr Inc</name><user>respondr</user><email>admin@respondr.io</email></author><author><name>Adrian Speyer</name><user>AdrianSpeyer</user><email>adriansprojects@gmail.com</email></author></authors>
|
13 |
+
<date>2015-10-02</date>
|
14 |
+
<time>02:33:15</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="RespondrMage"><dir name="RespondrAnalytics"><dir name="Block"><file name="Respondr.php" hash="3a5c1809076cbc8b4ba42e3551a547dd"/></dir><dir name="Helper"><file name="Data.php" hash="382a343ebde881fc0835c43c5e43f7f9"/></dir><dir name="Model"><file name="Observer.php" hash="7301ca92b1762223cf8228439fa8468e"/></dir><dir name="controllers"><file name="IndexController.php" hash="b437f47ccb078744ee6cc6f9f993bdab"/></dir><dir name="etc"><file name="adminhtml.xml" hash="b28f4ddc5e0851cff79bdc1624e1192c"/><file name="config.xml" hash="ba0e13559f0515126ea5b169e6fa6ab2"/><file name="system.xml" hash="6ce9befbcc8441b78ade8ac6c2568955"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="respondranalytics.xml" hash="27dc170600cb1d71cdcb7bacb6455230"/></dir><dir name="template"><dir name="respondranalytics"><file name="respondr.phtml" hash="ab2ddcc1cdba4fcdaedabcac0c9b4fa9"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="RespondrMage_RespondrAnalytics.xml" hash="9dd32f4b236640c74d1f08f5cb8e344d"/></dir></target><target name="magelocale"><dir name="de_DE"><file name="RespondrMage_RespondrAnalytics.csv" hash="788bc282a1e82ff83d93a70297435376"/></dir><dir name="en_US"><file name="RespondrMage_RespondrAnalytics.csv" hash="464c1c6e0ad748dadc01bf0a1e336287"/></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|