Metrilo_Analytics - Version 1.0.2

Version Notes

The first stable version of Metrilo's integration with Magento

Download this release

Release Info

Developer Murry Ivanoff
Extension Metrilo_Analytics
Version 1.0.2
Comparing to
See all releases


Code changes from version 1.0.1 to 1.0.2

app/code/community/Metrilo/Analytics/Helper/Data.php CHANGED
@@ -171,9 +171,13 @@ class Metrilo_Analytics_Helper_Data extends Mage_Core_Helper_Abstract
171
  {
172
  try {
173
  // Consider token is in the first level in the hashed json
 
174
  $call = array(
175
  'token' => $this->getApiToken(),
176
- 'events' => $ordersForSubmition
 
 
 
177
  );
178
 
179
  // Additional ksort here because of adding token param
171
  {
172
  try {
173
  // Consider token is in the first level in the hashed json
174
+ $version = (string)Mage::getConfig()->getModuleConfig("Metrilo_Analytics")->version;
175
  $call = array(
176
  'token' => $this->getApiToken(),
177
+ 'events' => $ordersForSubmition,
178
+ // for debugging/support purposes
179
+ 'platform' => 'Magento ' . Mage::getEdition() . ' ' . Mage::getVersion(),
180
+ 'version' => $version
181
  );
182
 
183
  // Additional ksort here because of adding token param
app/design/frontend/base/default/layout/metrilo_analytics.xml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <layout version="0.1.0">
3
+
4
+ <default>
5
+ <reference name="head">
6
+ <block type="metrilo_analytics/head" name="metrilo.analytics" template="metrilo/head.phtml" after="-" />
7
+ </reference>
8
+ </default>
9
+
10
+ </layout>
app/design/frontend/base/default/template/metrilo/head.phtml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $helper = Mage::helper('metrilo_analytics'); ?>
2
+ <?php $events = $this->getEvents(); ?>
3
+ <script type="text/javascript">
4
+ window.metrilo||(window.metrilo=[]),window.metrilo.queue=[],window.metrilo.methods=["identify","track","event","pageview","purchase","debug","atr"],
5
+ window.metrilo.skelet=function(e){return function(){a=Array.prototype.slice.call(arguments);a.unshift(e);window.metrilo.queue.push(a)}};
6
+ for(var i=0;window.metrilo.methods.length>i;i++){var mthd=window.metrilo.methods[i];window.metrilo[mthd]=window.metrilo.skelet(mthd)}
7
+ window.metrilo.load=function(e){var t=document,n=t.getElementsByTagName("script")[0],r=t.createElement("script");
8
+ r.type="text/javascript";r.async=true;r.src="//t.metrilo.com/j/"+e+".js";n.parentNode.insertBefore(r,n)};
9
+ metrilo.load("<?php echo $helper->getApiToken(); ?>");
10
+
11
+ <?php foreach ($events as $event) : ?>
12
+ <?php if($event['method'] == 'identify') : ?>
13
+ metrilo.identify("<?php echo $event['data']['id']; ?>", <?php echo json_encode($event['data']['params']); ?>);
14
+ <?php elseif($event['method'] == 'track') : ?>
15
+ <?php if(is_array($event['data'])): ?>
16
+ metrilo.event("<?php echo $event['type']; ?>", <?php echo json_encode($event['data']); ?>);
17
+ <?php else : ?>
18
+ <?php if($event['metaData']) : ?>
19
+ metrilo.event("<?php echo $event['type']; ?>", "<?php echo $event['data']; ?>", <?php echo json_encode($event['metaData']); ?>);
20
+ <?php else : ?>
21
+ metrilo.event("<?php echo $event['type']; ?>", "<?php echo $event['data']; ?>");
22
+ <?php endif; ?>
23
+ <?php endif; ?>
24
+ <?php endif; ?>
25
+ <?php endforeach; ?>
26
+ </script>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Metrilo_Analytics</name>
4
- <version>1.0.1</version>
5
  <stability>stable</stability>
6
  <license>Apache Software License (ASL)</license>
7
  <channel>community</channel>
@@ -21,8 +21,8 @@
21
  <notes>The first stable version of Metrilo's integration with Magento</notes>
22
  <authors><author><name>Murry Ivanoff</name><user>Metrilo</user><email>murry@metrilo.com</email></author><author><name>Miroslav Petrov</name><user>miro</user><email>miro91tn@gmail.com</email></author><author><name>Zhivko Draganov</name><user>zhivko</user><email>zhivko@metrilo.com</email></author></authors>
23
  <date>2015-11-17</date>
24
- <time>15:02:29</time>
25
- <contents><target name="magecommunity"><dir name="Metrilo"><dir name="Analytics"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><file name="Button.php" hash="70aadb3d62d998a3076bd4f9209db560"/></dir></dir></dir></dir><file name="Head.php" hash="7fc6870506f8882520b4e2b9596600d7"/></dir><dir name="Helper"><file name="Data.php" hash="4930ff4f95f3b80a7cfb7590e6d1ac44"/></dir><dir name="Model"><file name="Import.php" hash="1eb20cd00c210ee378039edb8d0515dc"/><file name="Observer.php" hash="720905b3bdff1d71df92e32fee81ae04"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="AjaxController.php" hash="0a16196c1c62b3359508b0b688a36e04"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="00c90fdba5e48bb35367c16c83abd6a7"/><file name="config.xml" hash="4708aed8284ec5c1457ca08a5ae079f6"/><file name="system.xml" hash="7564c68e51df23d7975bc1c9ead7be8f"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="metrilo_analytics.xml" hash="0e6911e2e883992f2182969286d929b1"/></dir><dir name="template"><dir name="metrilo"><dir name="system"><dir name="config"><file name="button.phtml" hash="528d7eb52bf996b7b2a31e8c6a4d7d86"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="metrilo"><file name="favicon-metrilo.png" hash="743558f1e49a730be9d515197a36567b"/><file name="loader.gif" hash="e05e6bb35d035cac4f3e0c8af213e9ab"/><file name="logo.png" hash="e9e54afd81384e12f77aca4eaebf5be8"/><file name="styles.css" hash="da0c07513d917e4ad08ff50814b536e1"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Metrilo_Analytics.xml" hash="3a4dbecc4e093537f11dd4c8fa2756e7"/></dir></target></contents>
26
  <compatible/>
27
  <dependencies><required><php><min>5.2.1</min><max>5.6.22</max></php></required></dependencies>
28
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Metrilo_Analytics</name>
4
+ <version>1.0.2</version>
5
  <stability>stable</stability>
6
  <license>Apache Software License (ASL)</license>
7
  <channel>community</channel>
21
  <notes>The first stable version of Metrilo's integration with Magento</notes>
22
  <authors><author><name>Murry Ivanoff</name><user>Metrilo</user><email>murry@metrilo.com</email></author><author><name>Miroslav Petrov</name><user>miro</user><email>miro91tn@gmail.com</email></author><author><name>Zhivko Draganov</name><user>zhivko</user><email>zhivko@metrilo.com</email></author></authors>
23
  <date>2015-11-17</date>
24
+ <time>17:55:32</time>
25
+ <contents><target name="magecommunity"><dir name="Metrilo"><dir name="Analytics"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><file name="Button.php" hash="70aadb3d62d998a3076bd4f9209db560"/></dir></dir></dir></dir><file name="Head.php" hash="7fc6870506f8882520b4e2b9596600d7"/></dir><dir name="Helper"><file name="Data.php" hash="c26904a99d62abc38c25da4e032f5654"/></dir><dir name="Model"><file name="Import.php" hash="1eb20cd00c210ee378039edb8d0515dc"/><file name="Observer.php" hash="720905b3bdff1d71df92e32fee81ae04"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="AjaxController.php" hash="0a16196c1c62b3359508b0b688a36e04"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="00c90fdba5e48bb35367c16c83abd6a7"/><file name="config.xml" hash="4708aed8284ec5c1457ca08a5ae079f6"/><file name="system.xml" hash="7564c68e51df23d7975bc1c9ead7be8f"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="metrilo_analytics.xml" hash="0e6911e2e883992f2182969286d929b1"/></dir><dir name="template"><dir name="metrilo"><dir name="system"><dir name="config"><file name="button.phtml" hash="528d7eb52bf996b7b2a31e8c6a4d7d86"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="metrilo_analytics.xml" hash="c7dcf4057bc31d906865e82159ac5eca"/></dir><dir name="template"><dir name="metrilo"><file name="head.phtml" hash="88ef4715cd7c7b675046faf1cf84fe4f"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="metrilo"><file name="favicon-metrilo.png" hash="743558f1e49a730be9d515197a36567b"/><file name="loader.gif" hash="e05e6bb35d035cac4f3e0c8af213e9ab"/><file name="logo.png" hash="e9e54afd81384e12f77aca4eaebf5be8"/><file name="styles.css" hash="da0c07513d917e4ad08ff50814b536e1"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Metrilo_Analytics.xml" hash="3a4dbecc4e093537f11dd4c8fa2756e7"/></dir></target></contents>
26
  <compatible/>
27
  <dependencies><required><php><min>5.2.1</min><max>5.6.22</max></php></required></dependencies>
28
  </package>