Inside_Analytics - Version 2.6.0

Version Notes

New Features
- added empty search tag
- added out of stock tag
- fixed loading of category and product on cached pages

Download this release

Release Info

Developer Hadar Paz
Extension Inside_Analytics
Version 2.6.0
Comparing to
See all releases


Code changes from version 2.5.0 to 2.6.0

app/code/community/Inside/Analytics/Model/Observer.php CHANGED
@@ -57,5 +57,28 @@ class Inside_Analytics_Model_Observer {
57
  }
58
  Mage::helper('inside')->log('LEAVING: '.__METHOD__, true);
59
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  }
61
 
57
  }
58
  Mage::helper('inside')->log('LEAVING: '.__METHOD__, true);
59
  }
60
+
61
+ public function setEmptySearch(Varien_Event_Observer $observer)
62
+ {
63
+ $layout = $observer->getEvent()->getLayout();
64
+ /* @var $layout Mage_Core_Model_Layout */
65
+ $action = $observer->getEvent()->getAction();
66
+ /* @var $action Mage_Core_Controller_Varien_Action */
67
+ $block = null;
68
+ switch ($action->getFullActionName()) {
69
+ case 'catalogsearch_advanced_result':
70
+ $block = $layout->getBlock('catalogsearch_advanced_result');
71
+ break;
72
+ case 'catalogsearch_result_index':
73
+ $block = $layout->getBlock('search.result');
74
+ break;
75
+ default:
76
+ return $this;
77
+ }
78
+ if ($block) {
79
+ Mage::register('search_results_count', $block->getResultCount(), true);
80
+ }
81
+ return $this;
82
+ }
83
  }
84
 
app/code/community/Inside/Analytics/Model/PageView.php CHANGED
@@ -24,6 +24,12 @@ class Inside_Analytics_Model_PageView extends Mage_Core_Model_Abstract {
24
  */
25
  protected $_category = null;
26
 
 
 
 
 
 
 
27
  /**
28
  * Build category name from page title
29
  * (applies to Amasty Improved Navigation and similar modules)
@@ -44,7 +50,7 @@ class Inside_Analytics_Model_PageView extends Mage_Core_Model_Abstract {
44
  /**
45
  * Gets array of pageTrack required data
46
  *
47
- * @param string $fullActionName
48
  * @return array
49
  */
50
  public function getPageTrackCodeData($requestArray)
@@ -59,7 +65,7 @@ class Inside_Analytics_Model_PageView extends Mage_Core_Model_Abstract {
59
  'orderId' => $this->_getOrderId(),
60
  'orderTotal' => $this->_getOrderTotal(),
61
  'shippingTotal' => $this->_getShippingTotal(),
62
- 'tags' => $this->_getTags(),
63
  );
64
  $pageSpecificData = $this->_getPageSpecificByType($type);
65
 
@@ -73,7 +79,7 @@ class Inside_Analytics_Model_PageView extends Mage_Core_Model_Abstract {
73
  /**
74
  * Gets array of order track data
75
  *
76
- * @param string $fullActionName
77
  * @return array
78
  */
79
  public function getOrderTrackCodeData($requestArray)
@@ -213,9 +219,24 @@ class Inside_Analytics_Model_PageView extends Mage_Core_Model_Abstract {
213
  return $id;
214
  }
215
 
216
- protected function _getTags()
 
 
 
 
 
 
217
  {
218
- return sprintf('language:%s', Mage::app()->getStore()->getCode());
 
 
 
 
 
 
 
 
 
219
  }
220
 
221
  /**
@@ -274,8 +295,15 @@ class Inside_Analytics_Model_PageView extends Mage_Core_Model_Abstract {
274
  protected function _loadProduct()
275
  {
276
  $product = Mage::registry('current_product');
 
 
 
 
 
 
277
  if ($product && $product->getId()) {
278
  $this->_product = $product;
 
279
  }
280
  return $this;
281
  }
@@ -287,6 +315,12 @@ class Inside_Analytics_Model_PageView extends Mage_Core_Model_Abstract {
287
  protected function _loadCategory()
288
  {
289
  $category = Mage::registry('current_category');
 
 
 
 
 
 
290
  if ($category && $category->getId()) {
291
  $this->_category = $category;
292
  }
24
  */
25
  protected $_category = null;
26
 
27
+ /**
28
+ * @var boolean
29
+ */
30
+ protected $_outOfStock = false;
31
+
32
+
33
  /**
34
  * Build category name from page title
35
  * (applies to Amasty Improved Navigation and similar modules)
50
  /**
51
  * Gets array of pageTrack required data
52
  *
53
+ * @param string $requestArray
54
  * @return array
55
  */
56
  public function getPageTrackCodeData($requestArray)
65
  'orderId' => $this->_getOrderId(),
66
  'orderTotal' => $this->_getOrderTotal(),
67
  'shippingTotal' => $this->_getShippingTotal(),
68
+ 'tags' => $this->_getTags($type),
69
  );
70
  $pageSpecificData = $this->_getPageSpecificByType($type);
71
 
79
  /**
80
  * Gets array of order track data
81
  *
82
+ * @param string $requestArray
83
  * @return array
84
  */
85
  public function getOrderTrackCodeData($requestArray)
219
  return $id;
220
  }
221
 
222
+ /**
223
+ * Gets custom tags string
224
+ *
225
+ * @param string $type The page type
226
+ * @return string
227
+ */
228
+ protected function _getTags($type)
229
  {
230
+ $return = sprintf('language:%s', Mage::app()->getStore()->getCode());
231
+ if ($this->_outOfStock) {
232
+ $return.=', outofstock';
233
+ }
234
+ if ($type == Inside_Analytics_Model_System_Config_Source_Page_Type::SEARCH) {
235
+ if (Mage::registry('search_results_count') === 0) {
236
+ $return.=', emptysearch';
237
+ }
238
+ }
239
+ return $return;
240
  }
241
 
242
  /**
295
  protected function _loadProduct()
296
  {
297
  $product = Mage::registry('current_product');
298
+ if (!$product && Mage::getEdition() === Mage::EDITION_ENTERPRISE) {
299
+ //try to load from cache
300
+ $processor = Mage::getSingleton('enterprise_pagecache/processor');
301
+ $productId = $processor->getMetadata(Enterprise_PageCache_Model_Processor_Product::METADATA_PRODUCT_ID);
302
+ $product = Mage::getModel('catalog/product')->load($productId);
303
+ }
304
  if ($product && $product->getId()) {
305
  $this->_product = $product;
306
+ $this->_outOfStock = !$product->getData('is_in_stock');
307
  }
308
  return $this;
309
  }
315
  protected function _loadCategory()
316
  {
317
  $category = Mage::registry('current_category');
318
+ if (!$category && Mage::getEdition() === Mage::EDITION_ENTERPRISE) {
319
+ //try to load from cache
320
+ $processor = Mage::getSingleton('enterprise_pagecache/processor');
321
+ $categoryId = $processor->getMetadata(Enterprise_PageCache_Model_Processor_Category::METADATA_CATEGORY_ID);
322
+ $category = Mage::getModel('catalog/category')->load($categoryId);
323
+ }
324
  if ($category && $category->getId()) {
325
  $this->_category = $category;
326
  }
app/code/community/Inside/Analytics/etc/config.xml CHANGED
@@ -11,7 +11,7 @@
11
  <config>
12
  <modules>
13
  <Inside_Analytics>
14
- <version>2.5.0</version>
15
  </Inside_Analytics>
16
  </modules>
17
  <global>
@@ -85,6 +85,14 @@
85
  </insideanalytics_front_response_after>
86
  </observers>
87
  </controller_front_send_response_after>
 
 
 
 
 
 
 
 
88
  </events>
89
  <layout>
90
  <updates>
11
  <config>
12
  <modules>
13
  <Inside_Analytics>
14
+ <version>2.6.0</version>
15
  </Inside_Analytics>
16
  </modules>
17
  <global>
85
  </insideanalytics_front_response_after>
86
  </observers>
87
  </controller_front_send_response_after>
88
+ <controller_action_layout_generate_blocks_after>
89
+ <observers>
90
+ <insideanalytics_emptysearch_check>
91
+ <class>inside/observer</class>
92
+ <method>setEmptySearch</method>
93
+ </insideanalytics_emptysearch_check>
94
+ </observers>
95
+ </controller_action_layout_generate_blocks_after>
96
  </events>
97
  <layout>
98
  <updates>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Inside_Analytics</name>
4
- <version>2.5.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.inside.tm/servicecontract">Inside Service Contract</license>
7
  <channel>community</channel>
@@ -31,12 +31,14 @@ Call us for an online presentation:&lt;br /&gt;&#xD;
31
  USA Call Hadar on 310.661.0308 9AM - 6PM PST &lt;br /&gt;&#xD;
32
  AUS Call Michael on 03 8637 1534 9AM - 5PM EST </description>
33
  <notes>New Features&#xD;
34
- - endpoint server configuration&#xD;
 
 
35
  </notes>
36
  <authors><author><name>Hadar Paz</name><user>MAG001834167</user><email>hadar.paz@inside.tm</email></author></authors>
37
- <date>2014-10-01</date>
38
- <time>10:00:41</time>
39
- <contents><target name="magecommunity"><dir name="Inside"><dir name="Analytics"><dir name="Block"><dir name="Adminhtml"><dir name="Route"><dir name="Edit"><file name="Form.php" hash="1d33f13c65cd268aa609904a598a4a43"/><dir name="Tab"><file name="General.php" hash="3fb90a753247c42454d942b9c7c12b6a"/></dir><file name="Tabs.php" hash="aeb4125bde86d7d07a1b263e9a776274"/></dir><file name="Edit.php" hash="b250cc9a5b7252d3c8b78fac93bee273"/><file name="Grid.php" hash="6819b33d1e77a64724d3d0d0b61fe894"/></dir><file name="Route.php" hash="1116daacd2d91c25c1b11c238482e9ae"/><dir name="System"><dir name="Config"><dir name="Form"><dir name="Button"><file name="Clearlog.php" hash="2b15b253af80856c7e0f6b18229edb44"/><file name="Showlog.php" hash="3e44b43ce52b5d22806df05ef41fb59a"/></dir></dir></dir></dir></dir><file name="Analytics.php" hash="f05276c813c4300d154816eb065ee5cc"/></dir><dir name="Helper"><file name="Data.php" hash="685038ac4f7047db4f9b7a18fc16c401"/></dir><dir name="Model"><dir name="Container"><file name="Analytics.php" hash="4bc1c63b05071065d40d1863b5f1235f"/></dir><dir name="Mysql4"><dir name="Route"><file name="Collection.php" hash="8aceeaea4490909d1536f953ba1e28c1"/></dir><file name="Route.php" hash="ef1d9069d996c6e2886a73941fb44c61"/></dir><file name="Observer.php" hash="ff67935a1c07e0c04cf3127a61872cf3"/><dir name="PageView"><file name="Type.php" hash="f74edfe8d845645d3cb2265517306ccd"/></dir><file name="PageView.php" hash="f24017938b8583b82b3b24d7e70472be"/><file name="Route.php" hash="5d5adf4663faa265967e5ae40264b7a1"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Abstract.php" hash="ffd23e007fa3f9fea473c9183bf58bc7"/><dir name="Page"><file name="Type.php" hash="4991eba0607d35132c16b0c7deec0ec0"/></dir></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="DebugController.php" hash="50754bcbce36b1edc99e15445b7f06bc"/><file name="RouteController.php" hash="333445550bd1f8eedf1fc3e7321e1b0d"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="11fbacf4dd6153fdff62b160f3a3cf17"/><file name="cache.xml" hash="b87e8e77bcb7ff06ea305dc371f95719"/><file name="config.xml" hash="634c00e45e3bc9658cacf65956f288e3"/><file name="system.xml" hash="2b8092b04591fdcccbbecc3f19441a5c"/></dir><dir name="sql"><dir name="inside_setup"><file name="mysql4-upgrade-1.1.2-2.0.0.php" hash="e123452c8d68d8961663fe6508ca580c"/><file name="mysql4-upgrade-2.0.0-2.1.0.php" hash="59426151530545b4efc807fe22002a18"/><file name="mysql4-upgrade-2.1.0-2.2.0.php" hash="4543cc4128ef9345923e9ac71c05621d"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="inside"><file name="analytics.xml" hash="76a3e04439048e976f23cf7330851ddd"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="inside"><file name="analytics.xml" hash="5d64993f4dec32725664d4ac1073b431"/></dir></dir><dir name="template"><dir name="inside"><file name="analytics.phtml" hash="c08328c8084fe4b2b0fbf2dbcea12993"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Inside_Analytics.xml" hash="4a6e86a99302b7ddecadffb844c4c3a8"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="inside"><file name="route.js" hash="0067644797c73ca5be7c052fdcfaa78d"/></dir></dir></dir></dir></target></contents>
40
  <compatible/>
41
  <dependencies><required><php><min>5.2.13</min><max>6.0.0</max></php></required></dependencies>
42
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Inside_Analytics</name>
4
+ <version>2.6.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.inside.tm/servicecontract">Inside Service Contract</license>
7
  <channel>community</channel>
31
  USA Call Hadar on 310.661.0308 9AM - 6PM PST &lt;br /&gt;&#xD;
32
  AUS Call Michael on 03 8637 1534 9AM - 5PM EST </description>
33
  <notes>New Features&#xD;
34
+ - added empty search tag&#xD;
35
+ - added out of stock tag&#xD;
36
+ - fixed loading of category and product on cached pages&#xD;
37
  </notes>
38
  <authors><author><name>Hadar Paz</name><user>MAG001834167</user><email>hadar.paz@inside.tm</email></author></authors>
39
+ <date>2014-11-17</date>
40
+ <time>08:36:44</time>
41
+ <contents><target name="magecommunity"><dir name="Inside"><dir name="Analytics"><dir name="Block"><dir name="Adminhtml"><dir name="Route"><dir name="Edit"><file name="Form.php" hash="1d33f13c65cd268aa609904a598a4a43"/><dir name="Tab"><file name="General.php" hash="3fb90a753247c42454d942b9c7c12b6a"/></dir><file name="Tabs.php" hash="aeb4125bde86d7d07a1b263e9a776274"/></dir><file name="Edit.php" hash="b250cc9a5b7252d3c8b78fac93bee273"/><file name="Grid.php" hash="6819b33d1e77a64724d3d0d0b61fe894"/></dir><file name="Route.php" hash="1116daacd2d91c25c1b11c238482e9ae"/><dir name="System"><dir name="Config"><dir name="Form"><dir name="Button"><file name="Clearlog.php" hash="2b15b253af80856c7e0f6b18229edb44"/><file name="Showlog.php" hash="3e44b43ce52b5d22806df05ef41fb59a"/></dir></dir></dir></dir></dir><file name="Analytics.php" hash="f05276c813c4300d154816eb065ee5cc"/></dir><dir name="Helper"><file name="Data.php" hash="685038ac4f7047db4f9b7a18fc16c401"/></dir><dir name="Model"><dir name="Container"><file name="Analytics.php" hash="4bc1c63b05071065d40d1863b5f1235f"/></dir><dir name="Mysql4"><dir name="Route"><file name="Collection.php" hash="8aceeaea4490909d1536f953ba1e28c1"/></dir><file name="Route.php" hash="ef1d9069d996c6e2886a73941fb44c61"/></dir><file name="Observer.php" hash="c9e3467d0acf99a81b7e1804abb49750"/><dir name="PageView"><file name="Type.php" hash="f74edfe8d845645d3cb2265517306ccd"/></dir><file name="PageView.php" hash="4ed726ccfb7844ef34daa7f8effbe2c5"/><file name="Route.php" hash="5d5adf4663faa265967e5ae40264b7a1"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Abstract.php" hash="ffd23e007fa3f9fea473c9183bf58bc7"/><dir name="Page"><file name="Type.php" hash="4991eba0607d35132c16b0c7deec0ec0"/></dir></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="DebugController.php" hash="50754bcbce36b1edc99e15445b7f06bc"/><file name="RouteController.php" hash="333445550bd1f8eedf1fc3e7321e1b0d"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="11fbacf4dd6153fdff62b160f3a3cf17"/><file name="cache.xml" hash="b87e8e77bcb7ff06ea305dc371f95719"/><file name="config.xml" hash="63fc8dc1e6ae9c5827a94ec274918f74"/><file name="system.xml" hash="2b8092b04591fdcccbbecc3f19441a5c"/></dir><dir name="sql"><dir name="inside_setup"><file name="mysql4-upgrade-1.1.2-2.0.0.php" hash="e123452c8d68d8961663fe6508ca580c"/><file name="mysql4-upgrade-2.0.0-2.1.0.php" hash="59426151530545b4efc807fe22002a18"/><file name="mysql4-upgrade-2.1.0-2.2.0.php" hash="4543cc4128ef9345923e9ac71c05621d"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="inside"><file name="analytics.xml" hash="76a3e04439048e976f23cf7330851ddd"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="inside"><file name="analytics.xml" hash="5d64993f4dec32725664d4ac1073b431"/></dir></dir><dir name="template"><dir name="inside"><file name="analytics.phtml" hash="c08328c8084fe4b2b0fbf2dbcea12993"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Inside_Analytics.xml" hash="4a6e86a99302b7ddecadffb844c4c3a8"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="inside"><file name="route.js" hash="0067644797c73ca5be7c052fdcfaa78d"/></dir></dir></dir></dir></target></contents>
42
  <compatible/>
43
  <dependencies><required><php><min>5.2.13</min><max>6.0.0</max></php></required></dependencies>
44
  </package>